- make lineitem aware of its state: clicable, enabled, expandable
- switch TimezonePicker to use paged list pattern
- make action bar span the full width, so the home/back button can be customized
- add checkbox line item type
- customize switch and seekbar
- many other UI tweaks
Test: manually tested
Change-Id: I0a1559630073a53bc798802d680ce28e1b120c3c
diff --git a/res/layout/action_bar.xml b/res/layout/action_bar.xml
index 7646ed3..9dc897f 100644
--- a/res/layout/action_bar.xml
+++ b/res/layout/action_bar.xml
@@ -19,11 +19,20 @@
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">
+ android:gravity="end|center_vertical" >
+ <FrameLayout
+ android:id="@+id/action_bar_icon_container"
+ android:layout_width="@dimen/side_margin"
+ android:layout_height="@dimen/lens_header_height"
+ android:layout_alignParentStart="true">
+ <ImageView
+ style="@style/SettingIcon.ActionBar"/>
+ </FrameLayout>
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/side_margin"
style="@style/CarTitle"
android:textColor="@color/car_teal_700"
android:layout_gravity="center_vertical"
diff --git a/res/layout/action_bar_with_button.xml b/res/layout/action_bar_with_button.xml
index e45cff8..1e14bfa 100644
--- a/res/layout/action_bar_with_button.xml
+++ b/res/layout/action_bar_with_button.xml
@@ -19,8 +19,16 @@
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">
+ android:gravity="center_vertical">
+ <FrameLayout
+ android:id="@+id/action_bar_icon_container"
+ android:layout_width="@dimen/side_margin"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true">
+ <ImageView
+ style="@style/SettingIcon.ActionBar"/>
+ </FrameLayout>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
@@ -30,6 +38,7 @@
android:gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
+ android:layout_marginStart="@dimen/side_margin"
android:maxLines="1"
android:ellipsize="end"/>
@@ -37,6 +46,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
+ android:layout_gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/action_button2"
diff --git a/res/layout/action_bar_with_toggle.xml b/res/layout/action_bar_with_toggle.xml
index bb0af6a..1b7e335 100644
--- a/res/layout/action_bar_with_toggle.xml
+++ b/res/layout/action_bar_with_toggle.xml
@@ -20,6 +20,15 @@
android:layout_height="@dimen/lens_header_height"
android:gravity="center_vertical" >
+ <FrameLayout
+ android:id="@+id/action_bar_icon_container"
+ android:layout_width="@dimen/side_margin"
+ android:layout_height="@dimen/lens_header_height"
+ android:layout_alignParentStart="true">
+ <ImageView
+ style="@style/SettingIcon.ActionBar"/>
+ </FrameLayout>
+
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
@@ -29,14 +38,14 @@
android:layout_gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
+ android:layout_marginStart="@dimen/side_margin"
android:maxLines="1"
android:ellipsize="end"/>
<Switch
android:id="@+id/toggle_switch"
android:background="@null"
- android:layout_width="@dimen/stream_button_icon_size"
- android:layout_height="@dimen/stream_button_icon_size"
+ style="@style/SettingSwitch"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/action_bar_end_widget_margin_end" />
diff --git a/res/layout/app_compat_activity.xml b/res/layout/app_compat_activity.xml
index 3569ac8..fa7b834 100644
--- a/res/layout/app_compat_activity.xml
+++ b/res/layout/app_compat_activity.xml
@@ -26,7 +26,11 @@
android:layout_width="match_parent"
android:layout_height="@dimen/lens_header_height"
app:theme="@style/ActionBarStyle.Car"
- app:contentInsetStart="@dimen/stream_content_keyline_1" />
+ app:contentInsetStart="0dp" />
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/car_divider_height"
+ android:background="@color/car_list_divider"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/res/layout/checkbox_line_item.xml b/res/layout/checkbox_line_item.xml
new file mode 100644
index 0000000..11addd3
--- /dev/null
+++ b/res/layout/checkbox_line_item.xml
@@ -0,0 +1,48 @@
+<?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:id="@+id/dashboard_tile"
+ style="@style/LineItem" >
+
+ <CheckBox
+ android:id="@+id/checkbox"
+ android:layout_width="@dimen/stream_button_icon_size"
+ android:layout_height="@dimen/stream_button_icon_size"
+ android:layout_marginStart="@dimen/stream_card_keyline_1"
+ android:button="@drawable/ic_check_box"
+ android:layout_alignParentStart="true"
+ android:layout_centerVertical="true" />
+
+ <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_marginStart="@dimen/stream_card_keyline_3"
+ android:layout_marginEnd="@dimen/stream_card_keyline_3"
+ style="@style/CarBody2.SingleLine"
+ android:gravity="center_vertical"/>
+
+ <View
+ android:id="@+id/line_item_divider"
+ android:layout_alignParentBottom="true"
+ android:background="@color/car_list_divider"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/car_divider_height" />
+</RelativeLayout>
diff --git a/res/layout/icon_text_line_item.xml b/res/layout/icon_text_line_item.xml
index 0cc5262..773fb5f 100644
--- a/res/layout/icon_text_line_item.xml
+++ b/res/layout/icon_text_line_item.xml
@@ -22,6 +22,7 @@
android:id="@+id/icon"
android:layout_marginStart="@dimen/stream_card_keyline_1"
android:layout_alignParentStart="true"
+ android:layout_centerVertical="true"
style="@style/SettingIcon" />
<LinearLayout
android:layout_width="match_parent"
@@ -50,6 +51,13 @@
style="@style/SettingIcon"
android:layout_marginEnd="@dimen/stream_card_keyline_1"
android:layout_alignParentEnd="true"
+ android:layout_centerVertical="true"
android:src="@drawable/ic_chevron_right"
- android:visibility="gone"/>
+ android:tint="@color/text_body_1"/>
+ <View
+ android:id="@+id/line_item_divider"
+ android:layout_alignParentBottom="true"
+ android:background="@color/car_list_divider"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/car_divider_height" />
</RelativeLayout>
diff --git a/res/layout/icon_toggle_line_item.xml b/res/layout/icon_toggle_line_item.xml
index 113c45d..08fce25 100644
--- a/res/layout/icon_toggle_line_item.xml
+++ b/res/layout/icon_toggle_line_item.xml
@@ -16,7 +16,6 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/dashboard_tile"
style="@style/LineItem" >
<ImageView
@@ -50,9 +49,14 @@
</LinearLayout>
<Switch
android:id="@+id/toggle_switch"
- style="@style/SettingIcon"
- android:layout_marginEnd="@dimen/stream_card_keyline_1"
+ style="@style/SettingSwitch"
android:layout_alignParentEnd="true"
- android:switchMinWidth="@dimen/stream_button_icon_size"
- android:visibility="gone"/>
+ android:layout_centerVertical="true"
+ android:layout_marginEnd="@dimen/stream_card_keyline_1" />
+ <View
+ android:id="@+id/line_item_divider"
+ android:layout_alignParentBottom="true"
+ android:background="@color/car_list_divider"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/car_divider_height" />
</RelativeLayout>
diff --git a/res/layout/icon_widget_line_item.xml b/res/layout/icon_widget_line_item.xml
index 2e47a0a..77be271 100644
--- a/res/layout/icon_widget_line_item.xml
+++ b/res/layout/icon_widget_line_item.xml
@@ -47,7 +47,14 @@
style="@style/SettingIcon"
android:layout_marginEnd="@dimen/stream_card_keyline_1"
android:layout_alignParentEnd="true"
+ android:layout_centerVertical="true"
android:src="@drawable/ic_settings_gear"
android:background="@null"
android:visibility="gone" />
+ <View
+ android:id="@+id/line_item_divider"
+ android:layout_alignParentBottom="true"
+ android:background="@color/car_list_divider"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/car_divider_height" />
</RelativeLayout>
diff --git a/res/layout/seekbar_line_item.xml b/res/layout/seekbar_line_item.xml
index 88df404..770dde5 100644
--- a/res/layout/seekbar_line_item.xml
+++ b/res/layout/seekbar_line_item.xml
@@ -15,19 +15,31 @@
~ limitations under the License
-->
-<LinearLayout
+<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/LineItem"
- android:layout_marginStart="@dimen/stream_card_keyline_1"
- android:layout_marginEnd="@dimen/stream_card_keyline_3"
- android:orientation="vertical" >
- <TextView
- android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- style="@style/CarBody2.SingleLine" />
- <SeekBar
- android:id="@+id/seekbar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
-</LinearLayout>
\ No newline at end of file
+ style="@style/LineItem" >
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_centerVertical="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginStart="@dimen/stream_card_keyline_1"
+ android:layout_marginEnd="@dimen/stream_card_keyline_3" >
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ style="@style/CarBody2.SingleLine" />
+ <SeekBar
+ android:id="@+id/seekbar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ </LinearLayout>
+ <View
+ android:id="@+id/line_item_divider"
+ android:layout_alignParentBottom="true"
+ android:background="@color/car_list_divider"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/car_divider_height" />
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/text_line_item.xml b/res/layout/text_line_item.xml
index 98f1d3b..f9bda63 100644
--- a/res/layout/text_line_item.xml
+++ b/res/layout/text_line_item.xml
@@ -15,20 +15,42 @@
~ limitations under the License
-->
-<LinearLayout
+<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/LineItem"
- android:layout_marginStart="@dimen/stream_card_keyline_1"
- android:orientation="vertical" >
- <TextView
- android:id="@+id/title"
+ style="@style/LineItem" >
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/CarBody1.SingleLine" />
- <TextView
- android:id="@+id/desc"
+ android:orientation="vertical"
+ android:layout_centerVertical="true"
+ android:gravity="center_vertical"
+ android:layout_alignParentStart="true"
+ android:layout_marginStart="@dimen/stream_card_keyline_1"
+ android:layout_marginEnd="@dimen/stream_card_keyline_3" >
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ style="@style/CarBody1.SingleLine" />
+ <TextView
+ android:id="@+id/desc"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ style="@style/CarBody2.SingleLine"
+ android:layout_marginTop="@dimen/double_line_text_margin" />
+ </LinearLayout>
+ <ImageView
+ android:id="@+id/right_chevron"
+ style="@style/SettingIcon"
+ android:layout_marginEnd="@dimen/stream_card_keyline_1"
+ android:layout_alignParentEnd="true"
+ android:layout_centerVertical="true"
+ android:src="@drawable/ic_chevron_right"
+ android:tint="@color/text_body_1"/>
+ <View
+ android:id="@+id/line_item_divider"
+ android:layout_alignParentBottom="true"
+ android:background="@color/car_list_divider"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/double_line_text_margin"
- style="@style/CarBody2.SingleLine" />
-</LinearLayout>
\ No newline at end of file
+ android:layout_height="@dimen/car_divider_height" />
+</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/toggle_line_item.xml b/res/layout/toggle_line_item.xml
index b103af2..abd09df 100644
--- a/res/layout/toggle_line_item.xml
+++ b/res/layout/toggle_line_item.xml
@@ -42,8 +42,14 @@
</LinearLayout>
<Switch
android:id="@+id/toggle_switch"
- style="@style/SettingIcon"
+ style="@style/SettingSwitch"
android:layout_alignParentEnd="true"
- android:layout_marginEnd="@dimen/stream_card_keyline_1"
- android:switchMinWidth="@dimen/stream_button_icon_size"/>
+ android:layout_centerVertical="true"
+ android:layout_marginEnd="@dimen/stream_card_keyline_1"/>
+ <View
+ android:id="@+id/line_item_divider"
+ android:layout_alignParentBottom="true"
+ android:background="@color/car_list_divider"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/car_divider_height" />
</com.android.car.settings.common.InterceptTouchRelativeLayout>
\ No newline at end of file