- refact to use fragments
- use AppCompatActivity so the app bar is more customizable
- switch couple more setting page to use pagedList pattern
Test: manually verified
Change-Id: I936006c07c79e43cc02640916450493a90bcfe3b
diff --git a/res/layout/volume_list.xml b/res/layout/action_bar.xml
similarity index 60%
copy from res/layout/volume_list.xml
copy to res/layout/action_bar.xml
index 57c6e1d..7646ed3 100644
--- a/res/layout/volume_list.xml
+++ b/res/layout/action_bar.xml
@@ -15,19 +15,20 @@
~ limitations under the License
-->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- <include
- android:id="@+id/media_volume"
+<RelativeLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/lens_header_height"
+ android:gravity="end|center_vertical">
+ <TextView
+ android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- layout="@layout/volume_controller_view" />
- <include
- android:id="@+id/ring_volume"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- layout="@layout/volume_controller_view" />
-</LinearLayout>
\ No newline at end of file
+ style="@style/CarTitle"
+ android:textColor="@color/car_teal_700"
+ android:layout_gravity="center_vertical"
+ android:layout_centerVertical="true"
+ android:layout_alignParentStart="true"
+ android:maxLines="1"
+ android:ellipsize="end"/>
+</RelativeLayout>
diff --git a/res/layout/action_bar_with_button.xml b/res/layout/action_bar_with_button.xml
index d716608..e45cff8 100644
--- a/res/layout/action_bar_with_button.xml
+++ b/res/layout/action_bar_with_button.xml
@@ -18,40 +18,45 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="@dimen/action_bar_height"
- android:gravity="end|center_vertical" >
+ android:layout_height="@dimen/lens_header_height"
+ android:gravity="end|center_vertical">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/CarTitle"
+ android:textColor="@color/car_teal_700"
android:gravity="center_vertical"
+ android:layout_centerVertical="true"
android:layout_alignParentStart="true"
- android:maxLines="1"/>
+ android:maxLines="1"
+ android:ellipsize="end"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:orientation="horizontal">
- <Button
+ <TextView
android:id="@+id/action_button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
- android:textSize="@dimen/medium_text_size"
+ style="@style/CarTitle"
+ android:textColor="@color/car_teal_700"
android:visibility="gone"
android:layout_marginEnd="@dimen/button_margin" />
- <Button
+ <TextView
android:id="@+id/action_button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@null"
- android:textSize="@dimen/medium_text_size"
+ style="@style/CarTitle"
+ android:textColor="@color/car_teal_700"
android:layout_marginEnd="@dimen/action_bar_end_widget_margin_end" />
</LinearLayout>
</RelativeLayout>
diff --git a/res/layout/action_bar_with_toggle.xml b/res/layout/action_bar_with_toggle.xml
index d69a49c..bb0af6a 100644
--- a/res/layout/action_bar_with_toggle.xml
+++ b/res/layout/action_bar_with_toggle.xml
@@ -17,7 +17,7 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="@dimen/action_bar_height"
+ android:layout_height="@dimen/lens_header_height"
android:gravity="center_vertical" >
<TextView
@@ -25,16 +25,18 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/CarTitle"
+ android:textColor="@color/car_teal_700"
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
- android:maxLines="1"/>
+ android:maxLines="1"
+ android:ellipsize="end"/>
<Switch
android:id="@+id/toggle_switch"
android:background="@null"
- android:layout_width="@dimen/icon_size"
- android:layout_height="@dimen/icon_size"
+ android:layout_width="@dimen/stream_button_icon_size"
+ android:layout_height="@dimen/stream_button_icon_size"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/action_bar_end_widget_margin_end" />
diff --git a/res/layout/add_wifi.xml b/res/layout/add_wifi.xml
index 760b0de..a03929c 100644
--- a/res/layout/add_wifi.xml
+++ b/res/layout/add_wifi.xml
@@ -27,7 +27,7 @@
android:id="@+id/wifi_name_display"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size" />
+ style="@style/CarBody1.SingleLine" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -37,7 +37,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
- android:textSize="@dimen/medium_text_size"
+ style="@style/CarBody1"
android:hint="@string/wifi_ssid_hint" />
</android.support.design.widget.TextInputLayout>
</ViewSwitcher>
@@ -51,7 +51,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
- android:textSize="@dimen/medium_text_size"
+ style="@style/CarBody1"
android:inputType="textPassword"
android:hint="@string/wifi_password" />
</android.support.design.widget.TextInputLayout>
diff --git a/res/layout/volume_list.xml b/res/layout/app_compat_activity.xml
similarity index 67%
rename from res/layout/volume_list.xml
rename to res/layout/app_compat_activity.xml
index 57c6e1d..3569ac8 100644
--- a/res/layout/volume_list.xml
+++ b/res/layout/app_compat_activity.xml
@@ -17,17 +17,18 @@
<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" >
- <include
- android:id="@+id/media_volume"
+ android:orientation="vertical">
+ <android.support.v7.widget.Toolbar
+ android:id="@+id/toolbar"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- layout="@layout/volume_controller_view" />
- <include
- android:id="@+id/ring_volume"
+ android:layout_height="@dimen/lens_header_height"
+ app:theme="@style/ActionBarStyle.Car"
+ app:contentInsetStart="@dimen/stream_content_keyline_1" />
+ <FrameLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- layout="@layout/volume_controller_view" />
-</LinearLayout>
\ No newline at end of file
+ android:layout_height="match_parent"
+ android:id="@+id/fragment_container"/>
+</LinearLayout>
diff --git a/res/layout/application_details.xml b/res/layout/application_details.xml
deleted file mode 100644
index ec0ee4c..0000000
--- a/res/layout/application_details.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ 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
- -->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginStart="@dimen/stream_card_keyline_1"
- android:layout_marginEnd="@dimen/stream_card_keyline_1"
- android:orientation="vertical">
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <ImageView
- android:id="@+id/icon"
- android:layout_width="@dimen/icon_size"
- android:layout_height="@dimen/icon_size"
- android:layout_centerVertical="true"
- android:layout_marginStart="@dimen/stream_card_keyline_1"
- android:layout_alignParentStart="true"
- style="@style/SettingIcon"/>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_toEndOf="@+id/icon"
- android:layout_centerVertical="true"
- android:paddingTop="@dimen/tile_top_bottom_padding"
- android:paddingBottom="@dimen/tile_top_bottom_padding">
- <TextView
- android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size"/>
- <TextView
- android:id="@+id/desc"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="@dimen/small_text_size"
- android:visibility="gone"/>
- </LinearLayout>
- </RelativeLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/tile_top_bottom_padding"
- android:orientation="horizontal">
- <Button
- android:id="@+id/disable_toggle"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:textSize="@dimen/small_text_size"
- android:layout_weight="1"/>
- <Button
- android:id="@+id/force_stop"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:textSize="@dimen/small_text_size"
- android:layout_weight="1"
- android:text="@string/force_stop"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
- <LinearLayout
- android:id="@+id/permission_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/tile_top_bottom_padding"
- android:orientation="vertical">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size"
- android:text="@string/permissions_label"/>
- <TextView
- android:id="@+id/permission_detail"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="@dimen/small_text_size"
- android:text="@string/computing_size"/>
- </LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/tile_top_bottom_padding"
- android:orientation="vertical">
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size"
- android:text="@string/data_usage_summary_title"/>
- <TextView
- android:id="@+id/data_usage_summary"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="@dimen/small_text_size"
- android:text="@string/computing_size"/>
- </LinearLayout>
- </LinearLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/bluetooth_details.xml b/res/layout/bluetooth_details.xml
index 6945435..75fbffa 100644
--- a/res/layout/bluetooth_details.xml
+++ b/res/layout/bluetooth_details.xml
@@ -28,14 +28,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true"
- android:textSize="@dimen/medium_text_size"
+ style="@style/CarBody1"
android:hint="@string/bluetooth_preference_paired_dialog_name_label" />
</android.support.design.widget.TextInputLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/bluetooth_device_advanced_profile_header_title"
- android:textSize="@dimen/medium_text_size"/>
+ style="@style/CarBody1"/>
<com.android.car.view.PagedListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/list"
diff --git a/res/layout/bluetooth_list.xml b/res/layout/bluetooth_list.xml
index 1f04c86..3c5b89c 100644
--- a/res/layout/bluetooth_list.xml
+++ b/res/layout/bluetooth_list.xml
@@ -41,6 +41,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bluetooth_disabled"
- android:textSize="@dimen/medium_text_size"/>
+ style="@style/CarBody1" />
</ViewSwitcher>
</LinearLayout>
diff --git a/res/layout/date_picker.xml b/res/layout/date_picker.xml
index 09cd956..6e78adc 100644
--- a/res/layout/date_picker.xml
+++ b/res/layout/date_picker.xml
@@ -15,19 +15,12 @@
~ limitations under the License
-->
-<LinearLayout
+<DatePicker
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- <DatePicker
- android:id="@+id/date_picker"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- <Button
- android:id="@+id/confirm"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size"
- android:text="@string/okay"/>
-</LinearLayout>
\ No newline at end of file
+ android:id="@+id/date_picker"
+ android:scaleX="1.5"
+ android:scaleY="1.5"
+ android:layout_gravity="center"
+ android:datePickerMode="spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
diff --git a/res/layout/icon_text_line_item.xml b/res/layout/icon_text_line_item.xml
index 1d12fed..0cc5262 100644
--- a/res/layout/icon_text_line_item.xml
+++ b/res/layout/icon_text_line_item.xml
@@ -24,7 +24,7 @@
android:layout_alignParentStart="true"
style="@style/SettingIcon" />
<LinearLayout
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerVertical="true"
@@ -34,12 +34,12 @@
android:layout_marginEnd="@dimen/stream_card_keyline_3" >
<TextView
android:id="@+id/title"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/CarBody1.SingleLine" />
<TextView
android:id="@+id/desc"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/CarBody2.SingleLine"
android:layout_marginTop="@dimen/double_line_text_margin"
diff --git a/res/layout/icon_toggle_line_item.xml b/res/layout/icon_toggle_line_item.xml
index 9db33a1..113c45d 100644
--- a/res/layout/icon_toggle_line_item.xml
+++ b/res/layout/icon_toggle_line_item.xml
@@ -53,6 +53,6 @@
style="@style/SettingIcon"
android:layout_marginEnd="@dimen/stream_card_keyline_1"
android:layout_alignParentEnd="true"
- android:switchMinWidth="@dimen/icon_size"
+ android:switchMinWidth="@dimen/stream_button_icon_size"
android:visibility="gone"/>
</RelativeLayout>
diff --git a/res/layout/in_list_header.xml b/res/layout/in_list_header.xml
deleted file mode 100644
index 3d70a17..0000000
--- a/res/layout/in_list_header.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<TextView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size" />
\ No newline at end of file
diff --git a/res/layout/text_line_item.xml b/res/layout/text_line_item.xml
index dd15538..98f1d3b 100644
--- a/res/layout/text_line_item.xml
+++ b/res/layout/text_line_item.xml
@@ -22,12 +22,12 @@
android:orientation="vertical" >
<TextView
android:id="@+id/title"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/CarBody1.SingleLine" />
<TextView
android:id="@+id/desc"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/double_line_text_margin"
style="@style/CarBody2.SingleLine" />
diff --git a/res/layout/time_picker.xml b/res/layout/time_picker.xml
index 835e379..4c21fe6 100644
--- a/res/layout/time_picker.xml
+++ b/res/layout/time_picker.xml
@@ -15,19 +15,12 @@
~ limitations under the License
-->
-<LinearLayout
+<TimePicker
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- <TimePicker
- android:id="@+id/time_picker"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- <Button
- android:id="@+id/confirm"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size"
- android:text="@string/okay"/>
-</LinearLayout>
\ No newline at end of file
+ android:id="@+id/time_picker"
+ android:scaleX="1.5"
+ android:scaleY="1.5"
+ android:layout_gravity="center"
+ android:timePickerMode="spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
diff --git a/res/layout/toggle_line_item.xml b/res/layout/toggle_line_item.xml
index 8a01185..b103af2 100644
--- a/res/layout/toggle_line_item.xml
+++ b/res/layout/toggle_line_item.xml
@@ -45,5 +45,5 @@
style="@style/SettingIcon"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/stream_card_keyline_1"
- android:switchMinWidth="@dimen/icon_size"/>
+ android:switchMinWidth="@dimen/stream_button_icon_size"/>
</com.android.car.settings.common.InterceptTouchRelativeLayout>
\ No newline at end of file
diff --git a/res/layout/volume_controller_view.xml b/res/layout/volume_controller_view.xml
deleted file mode 100644
index c384f95..0000000
--- a/res/layout/volume_controller_view.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ 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
- -->
-
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <ImageView
- android:id="@+id/icon"
- android:layout_width="@dimen/icon_size"
- android:layout_height="@dimen/icon_size"
- android:layout_alignParentStart="true"
- android:layout_centerVertical="true"
- android:layout_marginStart="@dimen/car_list_item_icon_right_margin"
- android:layout_marginEnd="@dimen/car_list_item_icon_right_margin" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingTop="@dimen/tile_top_bottom_padding"
- android:paddingBottom="@dimen/tile_top_bottom_padding"
- android:layout_toEndOf="@+id/icon" >
- <TextView
- android:id="@+id/stream_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size" />
- <SeekBar
- android:id="@+id/seekbar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- </LinearLayout>
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/wifi_list.xml b/res/layout/wifi_list.xml
index 21cfc73..ee1cffb 100644
--- a/res/layout/wifi_list.xml
+++ b/res/layout/wifi_list.xml
@@ -40,6 +40,6 @@
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="@dimen/medium_text_size"/>
+ style="@style/CarBody1"/>
</ViewSwitcher>
</LinearLayout>