Merge "DO NOT MERGE Add a new setting for Mobile Network within Network&Internet" into pi-car-dev
diff --git a/res/drawable/car_list_item_background.xml b/res/drawable/car_list_item_background.xml
deleted file mode 100644
index d20dc3b..0000000
--- a/res/drawable/car_list_item_background.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<ripple
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:color="@color/car_card_ripple_background">
- <item android:id="@android:id/mask">
- <color android:color="#ffffffff"/>
- </item>
-</ripple>
diff --git a/res/drawable/ic_bt_imaging.xml b/res/drawable/ic_bt_imaging.xml
deleted file mode 100644
index 810f68b..0000000
--- a/res/drawable/ic_bt_imaging.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:tint="@color/car_tint"
- android:viewportHeight="24.0"
- android:viewportWidth="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M19,8L5,8c-1.66,0 -3,1.34 -3,3v6h4v4h12v-4h4v-6c0,-1.66 -1.34,-3
- -3,-3zM16,19L8,19v-5h8v5zM19,12c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1
- -1,1zM18,3L6,3v4h12L18,3z"/>
-</vector>
diff --git a/res/drawable/ic_bt_laptop.xml b/res/drawable/ic_bt_laptop.xml
deleted file mode 100644
index 13d00b5..0000000
--- a/res/drawable/ic_bt_laptop.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:tint="@color/car_tint"
- android:viewportHeight="24.0"
- android:viewportWidth="24.0">
- <path
- android:fillColor="#FF000000"
- android:pathData="M20,18c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2H4c-1.1,0
- -2,0.9 -2,2v10c0,1.1 0.9,2 2,2H0v2h24v-2h-4zM4,6h16v10H4V6z"/>
-</vector>
diff --git a/res/drawable/spinner_background.xml b/res/drawable/spinner_background.xml
deleted file mode 100644
index 39a7519..0000000
--- a/res/drawable/spinner_background.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item>
- <layer-list>
- <item
- android:drawable="@drawable/ic_arrow_drop_down"
- android:gravity="right"/>
- </layer-list>
- </item>
-</selector>
diff --git a/res/layout/checkbox_list_item.xml b/res/layout/checkbox_list_item.xml
deleted file mode 100644
index d310c9a..0000000
--- a/res/layout/checkbox_list_item.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<com.android.car.settings.common.InterceptTouchRelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/ListItem.SingleLine">
-
- <CheckBox
- android:id="@+id/checkbox"
- android:layout_width="@dimen/car_primary_icon_size"
- android:layout_height="@dimen/car_primary_icon_size"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:layout_marginStart="@dimen/car_keyline_1"
- android:button="@drawable/ic_check_box"/>
-
- <TextView
- android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:layout_marginEnd="@dimen/car_keyline_1"
- android:layout_marginStart="@dimen/car_keyline_3"
- android:gravity="center_vertical"
- android:textAppearance="@style/TextAppearance.Car.Body1.SingleLine"/>
-
- <View
- android:id="@+id/list_item_divider"
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_list_divider_height"
- android:layout_alignParentBottom="true"
- android:background="@color/car_list_divider"/>
-</com.android.car.settings.common.InterceptTouchRelativeLayout>
diff --git a/res/layout/edit_text_list_item.xml b/res/layout/edit_text_list_item.xml
deleted file mode 100644
index 2ce6b45..0000000
--- a/res/layout/edit_text_list_item.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_double_line_list_item_height"
- android:layout_gravity="center_vertical"
- android:background="@drawable/car_list_item_background"
- android:orientation="vertical">
- <TextView
- android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Car.Body2.SingleLine"/>
- <EditText
- android:id="@+id/input"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Car.Body1"/>
-</LinearLayout>
diff --git a/res/layout/homepage.xml b/res/layout/homepage.xml
deleted file mode 100644
index 8869f56..0000000
--- a/res/layout/homepage.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<androidx.recyclerview.widget.RecyclerView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/recycler_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scrollbars="vertical"/>
diff --git a/res/layout/icon_text_list_item.xml b/res/layout/icon_text_list_item.xml
deleted file mode 100644
index de129d9..0000000
--- a/res/layout/icon_text_list_item.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/ListItem">
- <ImageView
- android:id="@+id/icon"
- style="@style/ListIcon"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:layout_marginStart="@dimen/car_keyline_1"/>
- <ImageView
- android:id="@+id/right_chevron"
- style="@style/ListIcon"
- android:layout_alignParentEnd="true"
- android:layout_centerVertical="true"
- android:layout_marginEnd="@dimen/car_keyline_1"
- android:src="@drawable/ic_chevron_right"
- android:tint="@color/text_body_1"/>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:layout_marginBottom="@dimen/optical_center_offset"
- android:layout_marginEnd="@dimen/car_keyline_3"
- android:layout_marginStart="@dimen/car_keyline_3"
- android:gravity="center_vertical"
- android:orientation="vertical">
- <TextView
- android:id="@+id/title"
- style="@style/TextAppearance.Car.Body1.SingleLine"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- <TextView
- android:id="@+id/desc"
- style="@style/TextAppearance.Car.Body2.SingleLine"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/car_padding_1"
- android:visibility="gone"/>
- </LinearLayout>
- <View
- android:id="@+id/list_item_divider"
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_list_divider_height"
- android:layout_alignParentBottom="true"
- android:background="@color/car_list_divider"/>
-</RelativeLayout>
diff --git a/res/layout/icon_widget_list_item.xml b/res/layout/icon_widget_list_item.xml
deleted file mode 100644
index 95f3f9b..0000000
--- a/res/layout/icon_widget_list_item.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/ListItem">
- <ImageView
- android:id="@+id/icon"
- style="@style/ListIcon"
- android:layout_alignParentStart="true"
- android:layout_marginStart="@dimen/car_keyline_1"/>
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:layout_marginEnd="@dimen/car_keyline_3"
- android:layout_marginStart="@dimen/car_keyline_3"
- android:orientation="vertical">
- <TextView
- android:id="@+id/title"
- style="@style/TextAppearance.Car.Body1.SingleLine"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- <TextView
- android:id="@+id/desc"
- style="@style/TextAppearance.Car.Body2.SingleLine"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone"/>
- </LinearLayout>
- <ImageButton
- android:id="@+id/action"
- style="@style/ListIcon"
- android:layout_alignParentEnd="true"
- android:layout_centerVertical="true"
- android:layout_marginEnd="@dimen/car_keyline_1"
- android:background="@null"
- android:src="@drawable/ic_settings_gear"
- android:visibility="gone"/>
- <View
- android:id="@+id/list_item_divider"
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_list_divider_height"
- android:layout_alignParentBottom="true"
- android:background="@color/car_list_divider"/>
-</RelativeLayout>
diff --git a/res/layout/list_fragment.xml b/res/layout/list_fragment.xml
deleted file mode 100644
index 3b0e2dd..0000000
--- a/res/layout/list_fragment.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<androidx.car.widget.PagedListView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:id="@+id/list"
- style="@style/SettingList"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:alignDividerStartTo="@id/container"
- app:showPagedListViewDivider="true"/>
diff --git a/res/layout/password_list_item.xml b/res/layout/password_list_item.xml
deleted file mode 100644
index 6beb726..0000000
--- a/res/layout/password_list_item.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/ListItem"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_double_line_list_item_height"
- android:gravity="center_vertical"
- android:orientation="vertical">
- <TextView
- android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Car.Body2.SingleLine"/>
- <EditText
- android:id="@+id/input"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Car.Body1"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_double_line_list_item_height"
- android:layout_marginTop="@dimen/list_item_top_margin"
- android:orientation="horizontal">
- <CheckBox
- android:id="@+id/checkbox"
- style="@style/TextAppearance.Car.Body1.SingleLine"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/car_touch_target_size"
- android:layout_centerVertical="true"
- android:button="@drawable/ic_check_box"
- android:paddingLeft="@dimen/car_padding_1"
- android:text="@string/show_password"/>
- </LinearLayout>
-</LinearLayout>
diff --git a/res/layout/single_text_list_item.xml b/res/layout/single_text_list_item.xml
deleted file mode 100644
index c840f59..0000000
--- a/res/layout/single_text_list_item.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/ListItem.SingleLine">
- <TextView
- android:id="@+id/title"
- style="@style/TextAppearance.Car.Body1.SingleLine"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:layout_marginEnd="@dimen/car_keyline_1"
- android:layout_marginStart="@dimen/car_keyline_1"
- android:gravity="center_vertical"/>
- <View
- android:id="@+id/list_item_divider"
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_list_divider_height"
- android:layout_alignParentBottom="true"
- android:background="@color/car_list_divider"/>
-</RelativeLayout>
diff --git a/res/layout/spinner.xml b/res/layout/spinner.xml
deleted file mode 100644
index f08b7ce..0000000
--- a/res/layout/spinner.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/spinnerTarget"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Car.Body1.SingleLine"/>
diff --git a/res/layout/spinner_drop_down.xml b/res/layout/spinner_drop_down.xml
deleted file mode 100644
index 940e154..0000000
--- a/res/layout/spinner_drop_down.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/spinnerTarget"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingBottom="@dimen/tile_top_bottom_padding"
- android:paddingStart="@dimen/car_keyline_1"
- android:paddingTop="@dimen/tile_top_bottom_padding"
- android:textAppearance="@style/TextAppearance.Car.Body1.SingleLine"/>
diff --git a/res/layout/spinner_list_item.xml b/res/layout/spinner_list_item.xml
deleted file mode 100644
index ccf23d3..0000000
--- a/res/layout/spinner_list_item.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_double_line_list_item_height"
- android:layout_centerVertical="true"
- android:background="@drawable/car_list_item_background"
- android:orientation="vertical">
- <TextView
- android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Car.Body2.SingleLine"/>
- <Spinner
- android:id="@+id/spinner"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/car_padding_1"
- android:background="@drawable/spinner_background"
- android:popupBackground="@color/car_card"/>
-</LinearLayout>
diff --git a/res/layout/wifi_list.xml b/res/layout/wifi_list.xml
deleted file mode 100644
index fb45414..0000000
--- a/res/layout/wifi_list.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2017 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <ViewSwitcher
- android:id="@+id/view_switcher"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <androidx.car.widget.PagedListView
- android:id="@+id/list"
- style="@style/SettingList"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:showPagedListViewDivider="false"/>
- <TextView
- android:id="@+id/message"
- style="@style/TextAppearance.Car.Body1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"/>
- </ViewSwitcher>
-</LinearLayout>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index cefd00d..e365c63 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -16,16 +16,6 @@
-->
<resources>
- <style name="ListItem">
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">@dimen/car_double_line_list_item_height</item>
- <item name="android:foreground">@drawable/car_list_item_background</item>
- </style>
-
- <style name="ListItem.SingleLine" parent="ListItem">
- <item name="android:layout_height">@dimen/car_single_line_list_item_height</item>
- </style>
-
<style name="TextAppearance.Car.Body1.SingleLine" parent="TextAppearance.Car.Body1">
<item name="android:maxLines">1</item>
<item name="android:ellipsize">marquee</item>
@@ -104,10 +94,6 @@
<item name="android:tint">@color/car_tint_light</item>
</style>
- <style name="SettingsListHeader" parent="TextAppearance.Car.Body2">
- <item name="android:textColor">@color/car_accent</item>
- </style>
-
<style name="SetupWizardButton.Negative" parent="@style/SuwGlifButton.Secondary">
<!-- Negative margin to offset for padding of the button itself. We want the label to be
aligned with the text above it -->
diff --git a/src/com/android/car/settings/common/CheckBoxListItem.java b/src/com/android/car/settings/common/CheckBoxListItem.java
deleted file mode 100644
index 15d26e6..0000000
--- a/src/com/android/car/settings/common/CheckBoxListItem.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.common;
-
-import android.view.View;
-import android.widget.CheckBox;
-import android.widget.TextView;
-
-import androidx.annotation.LayoutRes;
-import androidx.annotation.NonNull;
-import androidx.car.uxrestrictions.CarUxRestrictions;
-import androidx.car.widget.ListItem;
-
-import com.android.car.settings.R;
-
-/**
- * Represents a listItem with title text and a checkbox.
- */
-public abstract class CheckBoxListItem extends ListItem<CheckBoxListItem.ViewHolder> {
- private final String mTitle;
- private boolean mIsEnabled = true;
-
- public CheckBoxListItem(String title) {
- mTitle = title;
- }
-
- /**
- * @return whether the CheckBox is checked
- */
- public abstract boolean isChecked();
-
- @LayoutRes
- public static final int getViewLayoutId() {
- return R.layout.checkbox_list_item;
- }
-
- /**
- * Creates a {@link CheckBoxListItem.ViewHolder}.
- */
- public static ViewHolder createViewHolder(View itemView) {
- return new ViewHolder(itemView);
- }
-
- @Override
- public final int getViewType() {
- return CustomListItemTypes.CHECK_BOX_VIEW_TYPE;
- }
-
- @Override
- public void setEnabled(boolean enabled) {
- mIsEnabled = enabled;
- }
-
- @Override
- protected void resolveDirtyState() {
- // nothing to resolve.
- }
-
- @Override
- protected void onBind(ViewHolder viewHolder) {
- viewHolder.titleView.setText(mTitle);
- viewHolder.titleView.setEnabled(mIsEnabled);
- viewHolder.checkbox.setChecked(isChecked());
- viewHolder.checkbox.setEnabled(mIsEnabled);
- viewHolder.itemView.setOnClickListener(this::onClick);
- viewHolder.itemView.setEnabled(mIsEnabled);
- }
-
- /**
- * Called when the ListItem is clicked, default behavior is nothing.
- *
- * @param view Passed in by the view's onClick listener
- */
- public void onClick(View view) {
- // do nothing
- }
-
- static class ViewHolder extends ListItem.ViewHolder {
- public final TextView titleView;
- public final CheckBox checkbox;
-
- ViewHolder(View view) {
- super(view);
- titleView = view.findViewById(R.id.title);
- checkbox = view.findViewById(R.id.checkbox);
- }
-
- @Override
- public void onUxRestrictionsChanged(@NonNull CarUxRestrictions restrictions) {
- // no-op
- }
- }
-}
diff --git a/src/com/android/car/settings/common/CustomListItemTypes.java b/src/com/android/car/settings/common/CustomListItemTypes.java
deleted file mode 100644
index 859215c..0000000
--- a/src/com/android/car/settings/common/CustomListItemTypes.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.car.settings.common;
-
-/**
- * Keeps ViewType ids for all customer ListItems in a centralized location.
- */
-public final class CustomListItemTypes {
- // According to ListItemAdapter, customized view type needs to be negative.
- public static final int CHECK_BOX_VIEW_TYPE = -1;
- public static final int EDIT_TEXT_VIEW_TYPE = -2;
- public static final int PASSWORD_VIEW_TYPE = -3;
- public static final int SPINNER_VIEW_TYPE = -4;
-
- /**
- * No one should instantiate this class.
- */
- private CustomListItemTypes() {
- }
-}
diff --git a/src/com/android/car/settings/common/DOBlockingDialogFragment.java b/src/com/android/car/settings/common/DOBlockingDialogFragment.java
deleted file mode 100644
index 9802955..0000000
--- a/src/com/android/car/settings/common/DOBlockingDialogFragment.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.car.settings.common;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.os.Bundle;
-
-import androidx.fragment.app.DialogFragment;
-
-import com.android.car.settings.R;
-import com.android.car.settings.quicksettings.QuickSettingFragment;
-
-/**
- * A dialog to block non-distraction optimized view when restriction is applied.
- */
-public class DOBlockingDialogFragment extends DialogFragment implements
- DialogInterface.OnClickListener {
- public static final String DIALOG_TAG = "block_dialog_tag";
- private static final String MESSAGE_ARG_KEY = "message";
- private boolean mShowQuickSettingsMainScreen = true;
-
- /**
- * Creates a DOBlockingDialogFragment with a specified message
- *
- * @return an instance of DOBlockingDialogFragment
- */
- public static DOBlockingDialogFragment newInstance(String message) {
- DOBlockingDialogFragment fragment = new DOBlockingDialogFragment();
-
- Bundle args = new Bundle();
- args.putString(MESSAGE_ARG_KEY, message);
- fragment.setArguments(args);
-
- return fragment;
- }
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- Context context = getContext();
- // If a message is not set, use the default message.
- String message = getArguments().getString(MESSAGE_ARG_KEY);
- if (message == null) {
- message = getContext().getString(R.string.restricted_while_driving);
- }
- Dialog dialog = new AlertDialog.Builder(context)
- .setMessage(message)
- .setPositiveButton(context.getString(R.string.okay), /* listener= */ this)
- .setCancelable(false)
- .create();
- return dialog;
- }
-
- /**
- * Return to the quick settings main screen after the dialog is dismissed.
- *
- * @param showQuickSettingsMainScreen whether to return to the quick settings main screen, the
- * default value is true
- */
- public void goBackToQuickSettingsMainScreen(boolean showQuickSettingsMainScreen) {
- mShowQuickSettingsMainScreen = showQuickSettingsMainScreen;
- }
-
- // only one button, no need to check on negative.
- @Override
- public void onClick(DialogInterface dialog, int which) {
- if (mShowQuickSettingsMainScreen) {
- ((FragmentController) getActivity()).launchFragment(new QuickSettingFragment());
- }
- dismiss();
- }
-}
diff --git a/src/com/android/car/settings/common/EditTextListItem.java b/src/com/android/car/settings/common/EditTextListItem.java
deleted file mode 100644
index b4e3fba..0000000
--- a/src/com/android/car/settings/common/EditTextListItem.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.common;
-
-import android.text.Editable;
-import android.text.InputType;
-import android.text.TextUtils;
-import android.text.TextWatcher;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.TextView;
-
-import androidx.annotation.LayoutRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.car.uxrestrictions.CarUxRestrictions;
-import androidx.car.widget.ListItem;
-
-import com.android.car.settings.R;
-
-/**
- * Represents text only view of a title and a EditText as input.
- * @param <VH> class that extends {@link ListItem.ViewHolder}.
- */
-public class EditTextListItem<VH extends EditTextListItem.ViewHolder>
- extends ListItem<VH> {
- private final String mTitle;
- private final CharSequence mInitialInputText;
-
- /**
- * Interface that can be implemented to control behavior
- * when the text changes in the EditText.
- */
- public interface TextChangeListener {
- /**
- * Called when the EditText is changed.
- *
- * @param s Contents of EditText
- */
- void textChanged(Editable s);
- }
-
- private TextChangeListener mTextChangeListener;
- private EditText mEditText;
- protected TextType mTextType = TextType.NONE;
- protected boolean mIsEnabled = true;
-
- /**
- * Input flags that determine the way the EditText takes input.
- */
- public enum TextType {
- // None editable text
- NONE(0),
- // text input
- TEXT(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_NORMAL),
- // password, input is replaced by dot
- HIDDEN_PASSWORD(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD),
- // password, visible.
- VISIBLE_PASSWORD(
- InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
-
- private int mValue;
-
- TextType(int value) {
- mValue = value;
- }
-
- public int getValue() {
- return mValue;
- }
- }
-
- public EditTextListItem(String title) {
- this(title, null);
- }
-
- public EditTextListItem(String title, String initialInputText) {
- mTitle = title;
- mInitialInputText = initialInputText;
- }
-
- @LayoutRes
- public static int getViewLayoutId() {
- return R.layout.edit_text_list_item;
- }
-
- /**
- * Creates a {@link EditTextListItem.ViewHolder}.
- */
- public static ViewHolder createViewHolder(View itemView) {
- return new ViewHolder(itemView);
- }
-
- /**
- * Change the text type for the EditText
- */
- public void setTextType(TextType textType) {
- mTextType = textType;
- }
-
- protected TextType getTextType() {
- return mTextType;
- }
-
- /**
- * Change which object receives the TextChange calls
- *
- * @param listener listener to be called on text change
- */
- public void setTextChangeListener(TextChangeListener listener) {
- mTextChangeListener = listener;
- }
-
- /**
- * Returns the text contained in the EditText
- */
- @Nullable
- public String getInput() {
- return mEditText == null ? null : mEditText.getText().toString();
- }
-
- @Override
- public int getViewType() {
- return CustomListItemTypes.EDIT_TEXT_VIEW_TYPE;
- }
-
- @Override
- public void setEnabled(boolean enabled) {
- mIsEnabled = enabled;
- }
-
- protected boolean isEnabled() {
- return mIsEnabled;
- }
-
- @Override
- protected void resolveDirtyState() {
- // no-op
- }
-
- @Override
- protected void onBind(VH viewHolder) {
- viewHolder.titleView.setText(mTitle);
- viewHolder.titleView.setEnabled(mIsEnabled);
- mEditText = viewHolder.editText;
- mEditText.setEnabled(mIsEnabled);
- mEditText.setInputType(mTextType.getValue());
- if (!TextUtils.isEmpty(mInitialInputText)) {
- mEditText.setText(mInitialInputText);
- }
- mEditText.addTextChangedListener(new TextWatcher() {
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
- // don't care
- }
-
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {
- // dont' care
- }
-
- @Override
- public void afterTextChanged(Editable s) {
- if (mTextChangeListener != null) {
- mTextChangeListener.textChanged(s);
- }
- }
- });
- viewHolder.itemView.setEnabled(mIsEnabled);
- }
-
- static class ViewHolder extends ListItem.ViewHolder {
- public final TextView titleView;
- public final EditText editText;
-
- ViewHolder(View view) {
- super(view);
- titleView = view.findViewById(R.id.title);
- editText = view.findViewById(R.id.input);
- }
-
- @Override
- public void onUxRestrictionsChanged(@NonNull CarUxRestrictions restrictions) {
- // no-op
- }
- }
-}
diff --git a/src/com/android/car/settings/common/InterceptTouchRelativeLayout.java b/src/com/android/car/settings/common/InterceptTouchRelativeLayout.java
deleted file mode 100644
index ee614be..0000000
--- a/src/com/android/car/settings/common/InterceptTouchRelativeLayout.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.common;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.view.MotionEvent;
-import android.widget.RelativeLayout;
-
-/**
- * Intercepts all touch event, so they don't pass onto child views. One use case for this is to
- * make the list item in a list view clickable and control the logic and update the sub view.
- */
-public class InterceptTouchRelativeLayout extends RelativeLayout {
-
- public InterceptTouchRelativeLayout(Context context) {
- super(context);
- }
-
- public InterceptTouchRelativeLayout(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public InterceptTouchRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
-
- public InterceptTouchRelativeLayout(
- Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- }
-
- /**
- * Intercepts all touch event.
- * @return true.
- */
- @Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- return true;
- }
-}
diff --git a/src/com/android/car/settings/common/ListController.java b/src/com/android/car/settings/common/ListController.java
deleted file mode 100644
index e863f92..0000000
--- a/src/com/android/car/settings/common/ListController.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.car.settings.common;
-
-/**
- * Interface of list adapter for ListItem.
- */
-public interface ListController {
- /**
- * Triggers UI update on the list.
- */
- void refreshList();
-}
diff --git a/src/com/android/car/settings/common/ListItemSettingsFragment.java b/src/com/android/car/settings/common/ListItemSettingsFragment.java
deleted file mode 100644
index 60071df..0000000
--- a/src/com/android/car/settings/common/ListItemSettingsFragment.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.common;
-
-import android.content.Context;
-import android.os.Bundle;
-import android.view.View;
-
-import androidx.annotation.LayoutRes;
-import androidx.annotation.StringRes;
-import androidx.car.widget.ListItemAdapter;
-import androidx.car.widget.ListItemProvider;
-import androidx.car.widget.PagedListView;
-import androidx.car.widget.TextListItem;
-
-import com.android.car.settings.R;
-
-/**
- * Settings page that only contain a list of items.
- * <p>
- * Uses support library ListItemAdapter.
- */
-public abstract class ListItemSettingsFragment extends BaseFragment implements ListController {
- private ListItemAdapter mListAdapter;
-
- @Override
- @LayoutRes
- protected int getLayoutId() {
- return R.layout.list_fragment;
- }
-
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
-
- mListAdapter = new ListItemAdapter(getContext(), getItemProvider());
- mListAdapter.registerListItemViewType(CustomListItemTypes.CHECK_BOX_VIEW_TYPE,
- CheckBoxListItem.getViewLayoutId(), CheckBoxListItem::createViewHolder);
- mListAdapter.registerListItemViewType(CustomListItemTypes.EDIT_TEXT_VIEW_TYPE,
- EditTextListItem.getViewLayoutId(), EditTextListItem::createViewHolder);
- mListAdapter.registerListItemViewType(CustomListItemTypes.PASSWORD_VIEW_TYPE,
- PasswordListItem.getViewLayoutId(), PasswordListItem::createViewHolder);
- mListAdapter.registerListItemViewType(CustomListItemTypes.SPINNER_VIEW_TYPE,
- SpinnerListItem.getViewLayoutId(), SpinnerListItem::createViewHolder);
-
- PagedListView listView = getView().findViewById(R.id.list);
- listView.setAdapter(mListAdapter);
- listView.setDividerVisibilityManager(mListAdapter);
- listView.setMaxPages(PagedListView.UNLIMITED_PAGES);
- }
-
- @Override
- public void refreshList() {
- mListAdapter.notifyDataSetChanged();
- }
-
- /**
- * Called in onActivityCreated.
- * Gets ListItemProvider that should provide items to show up in the list.
- */
- public abstract ListItemProvider getItemProvider();
-
- protected TextListItem createSimpleListItem(@StringRes int titleResId,
- View.OnClickListener onClickListener) {
- Context context = requireContext();
- TextListItem item = new TextListItem(context);
- item.setTitle(context.getString(titleResId));
- item.setSupplementalIcon(R.drawable.ic_chevron_right, /* showDivider= */ false);
- item.setOnClickListener(onClickListener);
- return item;
- }
-}
diff --git a/src/com/android/car/settings/common/MutableListItemProvider.java b/src/com/android/car/settings/common/MutableListItemProvider.java
deleted file mode 100644
index 4eafa5b..0000000
--- a/src/com/android/car/settings/common/MutableListItemProvider.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.car.settings.common;
-
-import androidx.car.widget.ListItem;
-import androidx.car.widget.ListItemProvider;
-
-import java.util.List;
-
-/**
- * A wrapper around a list. The content can be swapped.
- *
- * @param <VH> class that extends {@link ListItem.ViewHolder}.
- */
-public class MutableListItemProvider<VH extends ListItem.ViewHolder> extends ListItemProvider {
- private List<ListItem<VH>> mItems;
-
- public MutableListItemProvider(List<ListItem<VH>> items) {
- mItems = items;
- }
-
- public void setItems(List<ListItem<VH>> items) {
- mItems = items;
- }
-
- @Override
- public ListItem<VH> get(int position) {
- return mItems.get(position);
- }
-
- @Override
- public int size() {
- return mItems.size();
- }
-}
diff --git a/src/com/android/car/settings/common/PasswordListItem.java b/src/com/android/car/settings/common/PasswordListItem.java
deleted file mode 100644
index a905091..0000000
--- a/src/com/android/car/settings/common/PasswordListItem.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.common;
-
-import android.view.View;
-import android.widget.CheckBox;
-
-import androidx.annotation.LayoutRes;
-
-import com.android.car.settings.R;
-
-/**
- * Contains logic for a list item that represents a text only view of a title and an EditText
- * password input followed by a checkbox to toggle between show/hide password.
- */
-public class PasswordListItem extends EditTextListItem<PasswordListItem.ViewHolder> {
- private boolean mShowPassword;
-
- public PasswordListItem(String title) {
- super(title, /* initialInputText= */ null);
- }
-
- @LayoutRes
- public static final int getViewLayoutId() {
- return R.layout.password_list_item;
- }
-
- /**
- * Creates a {@link PasswordListItem.ViewHolder}.
- */
- public static ViewHolder createViewHolder(View itemView) {
- return new ViewHolder(itemView);
- }
-
- @Override
- public void setTextType(TextType textType) {
- throw new UnsupportedOperationException("checkbox will automatically set TextType.");
- }
-
- @Override
- public final int getViewType() {
- return CustomListItemTypes.PASSWORD_VIEW_TYPE;
- }
-
-
- @Override
- protected void onBind(ViewHolder viewHolder) {
- // setTextType is public but with PasswordListItem it should only be
- // set to be one of the two types as follows so we use super and
- // throw exception on our setTextType.
- super.setTextType(mShowPassword ? TextType.VISIBLE_PASSWORD : TextType.HIDDEN_PASSWORD);
- super.onBind(viewHolder);
- viewHolder.checkbox.setChecked(mShowPassword);
- viewHolder.checkbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
- mShowPassword = isChecked;
- super.setTextType(mShowPassword
- ? TextType.VISIBLE_PASSWORD : TextType.HIDDEN_PASSWORD);
- viewHolder.editText.setInputType(getTextType().getValue());
- });
- viewHolder.checkbox.setEnabled(isEnabled());
- }
-
- static class ViewHolder extends EditTextListItem.ViewHolder {
- public final CheckBox checkbox;
-
- ViewHolder(View view) {
- super(view);
- checkbox = view.findViewById(R.id.checkbox);
- }
- }
-}
diff --git a/src/com/android/car/settings/common/SpinnerListItem.java b/src/com/android/car/settings/common/SpinnerListItem.java
deleted file mode 100644
index 885fed7..0000000
--- a/src/com/android/car/settings/common/SpinnerListItem.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.common;
-
-import android.content.Context;
-import android.view.View;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.Spinner;
-import android.widget.TextView;
-
-import androidx.annotation.LayoutRes;
-import androidx.annotation.NonNull;
-import androidx.car.uxrestrictions.CarUxRestrictions;
-import androidx.car.widget.ListItem;
-
-import com.android.car.settings.R;
-
-import java.util.List;
-
-/**
- * Represents a listItem with title text and a checkbox.
- * @param <T> type of item stored in the spinner.
- */
-public class SpinnerListItem<T> extends ListItem<SpinnerListItem.ViewHolder> {
- private final ArrayAdapter<T> mArrayAdapter;
- private final AdapterView.OnItemSelectedListener mOnItemSelectedListener;
- private final CharSequence mTitle;
- private final int mSelectedPosition;
- private boolean mIsEnabled = true;
-
- /**
- * Constructs a new SpinnerListItem
- *
- * @param context Android context
- * @param listener Listener for when an item in spinner is selected
- * @param items The List of items in the spinner
- * @param title The title next to the spinner
- * @param selectedPosition The starting position of the spinner
- */
- public SpinnerListItem(
- Context context,
- AdapterView.OnItemSelectedListener listener,
- List<T> items,
- CharSequence title,
- int selectedPosition) {
- mArrayAdapter = new ArrayAdapter(context, R.layout.spinner, items);
- mArrayAdapter.setDropDownViewResource(R.layout.spinner_drop_down);
- mOnItemSelectedListener = listener;
- mTitle = title;
- mSelectedPosition = selectedPosition;
- }
-
- @LayoutRes
- public static final int getViewLayoutId() {
- return R.layout.spinner_list_item;
- }
-
- /**
- * Creates a {@link SpinnerListItem.ViewHolder}.
- */
- public static ViewHolder createViewHolder(View itemView) {
- return new ViewHolder(itemView);
- }
-
- @Override
- public final int getViewType() {
- return CustomListItemTypes.SPINNER_VIEW_TYPE;
- }
-
- @Override
- public void setEnabled(boolean enabled) {
- mIsEnabled = enabled;
- }
-
- @Override
- protected void resolveDirtyState() {
- // nothing to resolve.
- }
-
- @Override
- protected void onBind(ViewHolder viewHolder) {
- viewHolder.spinner.setAdapter(mArrayAdapter);
- viewHolder.spinner.setSelection(mSelectedPosition);
- viewHolder.spinner.setOnItemSelectedListener(mOnItemSelectedListener);
- viewHolder.spinner.setEnabled(mIsEnabled);
- viewHolder.titleView.setText(mTitle);
- viewHolder.titleView.setEnabled(mIsEnabled);
- viewHolder.itemView.setEnabled(mIsEnabled);
- }
-
- /**
- * Returns the item in the given position
- */
- public T getItem(int position) {
- return mArrayAdapter.getItem(position);
- }
-
- static class ViewHolder extends ListItem.ViewHolder {
- public final Spinner spinner;
- public final TextView titleView;
-
- ViewHolder(View view) {
- super(view);
- spinner = view.findViewById(R.id.spinner);
- titleView = view.findViewById(R.id.title);
- }
-
- @Override
- public void onUxRestrictionsChanged(@NonNull CarUxRestrictions restrictions) {
- // no-op
- }
- }
-}
diff --git a/tests/robotests/src/com/android/car/settings/common/ErrorDialogTest.java b/tests/robotests/src/com/android/car/settings/common/ErrorDialogTest.java
index 7bd0654..e7f7abb 100644
--- a/tests/robotests/src/com/android/car/settings/common/ErrorDialogTest.java
+++ b/tests/robotests/src/com/android/car/settings/common/ErrorDialogTest.java
@@ -20,11 +20,12 @@
import static org.robolectric.RuntimeEnvironment.application;
+import androidx.fragment.app.Fragment;
+
import com.android.car.settings.CarSettingsRobolectricTestRunner;
import com.android.car.settings.R;
import com.android.car.settings.testutils.BaseTestActivity;
import com.android.car.settings.testutils.DialogTestUtils;
-import com.android.car.settings.testutils.TestBaseFragment;
import org.junit.Before;
import org.junit.Test;
@@ -39,7 +40,7 @@
public class ErrorDialogTest {
private static final String ERROR_DIALOG_TAG = "ErrorDialogTag";
private BaseTestActivity mTestActivity;
- private TestBaseFragment mTestFragment;
+ private Fragment mTestFragment;
@Before
public void setUpTestActivity() {
@@ -47,7 +48,7 @@
mTestActivity = Robolectric.setupActivity(BaseTestActivity.class);
- mTestFragment = new TestBaseFragment();
+ mTestFragment = new Fragment();
mTestActivity.launchFragment(mTestFragment);
}
diff --git a/tests/robotests/src/com/android/car/settings/testutils/ShadowActionListItem.java b/tests/robotests/src/com/android/car/settings/testutils/ShadowActionListItem.java
deleted file mode 100644
index 4ff0181..0000000
--- a/tests/robotests/src/com/android/car/settings/testutils/ShadowActionListItem.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.testutils;
-
-import android.graphics.drawable.Drawable;
-import android.view.View;
-
-import androidx.car.widget.ActionListItem;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-
-/**
- * Allows access to the internals of an {@link ActionListItem} for testing.
- */
-@Implements(ActionListItem.class)
-public class ShadowActionListItem {
- private CharSequence mTitle;
- private Drawable mIcon;
- private CharSequence mPrimaryActionText;
- private View.OnClickListener mPrimaryActionOnClickListener;
-
- @Implementation
- protected void setTitle(CharSequence title) {
- mTitle = title;
- }
-
- @Implementation
- protected void setPrimaryActionIcon(Drawable icon, int size) {
- mIcon = icon;
- }
-
- @Implementation
- protected void setAction(String text, boolean showDivider, View.OnClickListener listener) {
- mPrimaryActionText = text;
- mPrimaryActionOnClickListener = listener;
- }
-
- /**
- * Returns the title set on this item.
- */
- public CharSequence getTitle() {
- return mTitle;
- }
-
- /**
- * Returns the icon set on this item.
- */
- public Drawable getPrimaryActionIcon() {
- return mIcon;
- }
-
- /**
- * Returns the primary action text set on this item.
- */
- public CharSequence getPrimaryActionText() {
- return mPrimaryActionText;
- }
-
- /**
- * Returns the onclick listener for the first action.
- */
- public View.OnClickListener getPrimaryActionOnClickListener() {
- return mPrimaryActionOnClickListener;
- }
-}
diff --git a/tests/robotests/src/com/android/car/settings/testutils/ShadowTextListItem.java b/tests/robotests/src/com/android/car/settings/testutils/ShadowTextListItem.java
deleted file mode 100644
index 4db770b..0000000
--- a/tests/robotests/src/com/android/car/settings/testutils/ShadowTextListItem.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.testutils;
-
-import android.view.View;
-import android.widget.CompoundButton;
-
-import androidx.car.widget.TextListItem;
-
-import org.robolectric.annotation.Implementation;
-import org.robolectric.annotation.Implements;
-
-/**
- * Allows access to the internals of a text list item for testing.
- */
-@Implements(TextListItem.class)
-public class ShadowTextListItem {
- private int mSupplementalIconDrawableId;
- private View.OnClickListener mSupplementalIconOnClickListener;
- private CharSequence mTitle;
- private CharSequence mBody;
- private boolean mSwitchChecked;
- private CompoundButton.OnCheckedChangeListener mSwitchOnCheckedChangeListener;
- private View.OnClickListener mOnClickListener;
-
- @Implementation
- public void setSupplementalIcon(int iconResId, boolean showDivider,
- View.OnClickListener listener) {
- mSupplementalIconDrawableId = iconResId;
- mSupplementalIconOnClickListener = listener;
- }
-
- @Implementation
- protected void setTitle(CharSequence title) {
- mTitle = title;
- }
-
- @Implementation
- protected void setBody(CharSequence body) {
- mBody = body;
- }
-
- @Implementation
- protected void setBody(CharSequence body, boolean asPrimary) {
- mBody = body;
- }
-
- @Implementation
- protected void setSwitch(boolean checked, boolean showDivider,
- CompoundButton.OnCheckedChangeListener listener) {
- mSwitchChecked = checked;
- mSwitchOnCheckedChangeListener = listener;
- }
-
- @Implementation
- protected void setOnClickListener(View.OnClickListener listener) {
- mOnClickListener = listener;
- }
-
- /**
- * Returns the supplemental drawable id set on this item.
- */
- public int getSupplementalIconDrawableId() {
- return mSupplementalIconDrawableId;
- }
-
- /**
- * Returns the title set on this item.
- */
- public CharSequence getTitle() {
- return mTitle;
- }
-
- /**
- * Returns the body set on this item.
- */
- public CharSequence getBody() {
- return mBody;
- }
-
- /**
- * Returns whether the switch is checked.
- */
- public boolean getSwitchChecked() {
- return mSwitchChecked;
- }
-
- /**
- * Returns the on switch checked changed listener.
- */
- public CompoundButton.OnCheckedChangeListener getSwitchOnCheckedChangeListener() {
- return mSwitchOnCheckedChangeListener;
- }
-
- /**
- * Returns the onclick listener for this item.
- */
- public View.OnClickListener getOnClickListener() {
- return mOnClickListener;
- }
-
- /**
- * Returns the onclick listener for the supplemental icon.
- */
- public View.OnClickListener getSupplementalIconOnClickListener() {
- return mSupplementalIconOnClickListener;
- }
-}
diff --git a/tests/robotests/src/com/android/car/settings/testutils/TestBaseFragment.java b/tests/robotests/src/com/android/car/settings/testutils/TestBaseFragment.java
deleted file mode 100644
index 4d2ba82..0000000
--- a/tests/robotests/src/com/android/car/settings/testutils/TestBaseFragment.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.car.settings.testutils;
-
-import androidx.annotation.LayoutRes;
-
-import com.android.car.settings.R;
-import com.android.car.settings.common.BaseFragment;
-
-/**
- * Simple implementation of BaseFragment to be used in tests that require a fragment but don't care
- * which fragment is being used.
- */
-public class TestBaseFragment extends BaseFragment {
-
- @Override
- @LayoutRes
- protected int getLayoutId() {
- return R.layout.list_fragment;
- }
-}
diff --git a/tests/robotests/src/com/android/car/settings/users/ConfirmCreateNewUserDialogTest.java b/tests/robotests/src/com/android/car/settings/users/ConfirmCreateNewUserDialogTest.java
index 35844ff..53ae457 100644
--- a/tests/robotests/src/com/android/car/settings/users/ConfirmCreateNewUserDialogTest.java
+++ b/tests/robotests/src/com/android/car/settings/users/ConfirmCreateNewUserDialogTest.java
@@ -20,10 +20,11 @@
import static org.mockito.Mockito.verify;
+import androidx.fragment.app.Fragment;
+
import com.android.car.settings.CarSettingsRobolectricTestRunner;
import com.android.car.settings.testutils.BaseTestActivity;
import com.android.car.settings.testutils.DialogTestUtils;
-import com.android.car.settings.testutils.TestBaseFragment;
import org.junit.Before;
import org.junit.Test;
@@ -38,7 +39,7 @@
@RunWith(CarSettingsRobolectricTestRunner.class)
public class ConfirmCreateNewUserDialogTest {
private BaseTestActivity mTestActivity;
- private TestBaseFragment mTestFragment;
+ private Fragment mTestFragment;
private ConfirmCreateNewUserDialog mDialog;
@Before
@@ -47,7 +48,7 @@
mTestActivity = Robolectric.setupActivity(BaseTestActivity.class);
- mTestFragment = new TestBaseFragment();
+ mTestFragment = new Fragment();
mTestActivity.launchFragment(mTestFragment);
mDialog = new ConfirmCreateNewUserDialog();
diff --git a/tests/robotests/src/com/android/car/settings/users/ConfirmExitRetailModeDialogTest.java b/tests/robotests/src/com/android/car/settings/users/ConfirmExitRetailModeDialogTest.java
index c7e7047..db8ee92 100644
--- a/tests/robotests/src/com/android/car/settings/users/ConfirmExitRetailModeDialogTest.java
+++ b/tests/robotests/src/com/android/car/settings/users/ConfirmExitRetailModeDialogTest.java
@@ -20,10 +20,11 @@
import static org.mockito.Mockito.verify;
+import androidx.fragment.app.Fragment;
+
import com.android.car.settings.CarSettingsRobolectricTestRunner;
import com.android.car.settings.testutils.BaseTestActivity;
import com.android.car.settings.testutils.DialogTestUtils;
-import com.android.car.settings.testutils.TestBaseFragment;
import org.junit.Before;
import org.junit.Test;
@@ -38,7 +39,7 @@
@RunWith(CarSettingsRobolectricTestRunner.class)
public class ConfirmExitRetailModeDialogTest {
private BaseTestActivity mTestActivity;
- private TestBaseFragment mTestFragment;
+ private Fragment mTestFragment;
private ConfirmExitRetailModeDialog mDialog;
@Before
@@ -47,7 +48,7 @@
mTestActivity = Robolectric.setupActivity(BaseTestActivity.class);
- mTestFragment = new TestBaseFragment();
+ mTestFragment = new Fragment();
mTestActivity.launchFragment(mTestFragment);
mDialog = new ConfirmExitRetailModeDialog();