summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorYabin Huang <yabinh@google.com>2019-08-14 16:16:39 -0700
committerYabin Huang <yabinh@google.com>2019-08-20 17:53:28 +0000
commit0865200bf57593111b31dab6ba7816ae262f1f81 (patch)
treef6df0d5ef14cb4bfb682793d4c8a4635ab357f4c /res
parentecf17889fee7978af5f0cbb64a9e85dd4fa22301 (diff)
downloadplatform_packages_apps_Car_Dialer-0865200bf57593111b31dab6ba7816ae262f1f81.tar.gz
platform_packages_apps_Car_Dialer-0865200bf57593111b31dab6ba7816ae262f1f81.tar.bz2
platform_packages_apps_Car_Dialer-0865200bf57593111b31dab6ba7816ae262f1f81.zip
Update full screen error UI
1. Move shared resources and extract shared styles to libs/car-apps-common 2. Use a color selector for UxrButton so that the button can change text color in driving mode 3. Use a proper carUxRestrictions for UxrButton Bug: 138600044 Test: manual Change-Id: I394d2b929a5325b23d638b632761ecb87ea1a68e
Diffstat (limited to 'res')
-rw-r--r--res/drawable/hero_button_background.xml24
-rw-r--r--res/layout/add_favorite_list_item.xml5
-rw-r--r--res/layout/favorite_fragment.xml8
-rw-r--r--res/layout/no_hfp.xml12
-rw-r--r--res/values/colors.xml1
-rw-r--r--res/values/dimens.xml3
-rw-r--r--res/values/styles.xml6
7 files changed, 11 insertions, 48 deletions
diff --git a/res/drawable/hero_button_background.xml b/res/drawable/hero_button_background.xml
deleted file mode 100644
index 15e9b2a4..00000000
--- a/res/drawable/hero_button_background.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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="@*android:color/car_card_ripple_background">
- <item>
- <shape android:shape="rectangle">
- <solid android:color="@color/hero_button_background_color" />
- <corners android:radius="@dimen/hero_button_corner_radius"/>
- </shape>
- </item>
-</ripple>
diff --git a/res/layout/add_favorite_list_item.xml b/res/layout/add_favorite_list_item.xml
index c81fa3b0..2150ea09 100644
--- a/res/layout/add_favorite_list_item.xml
+++ b/res/layout/add_favorite_list_item.xml
@@ -15,15 +15,18 @@
-->
<com.android.car.apps.common.UxrButton
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/add_favorite_button"
android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textColor="@color/hero_button_text_color"
android:singleLine="true"
android:gravity="top|center_horizontal"
android:background="?android:attr/selectableItemBackground"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:drawableTop="@drawable/ic_add_favorite"
- android:drawablePadding="@dimen/favorites_avatar_margin_bottom"/>
+ android:drawablePadding="@dimen/favorites_avatar_margin_bottom"
+ app:carUxRestrictions="UX_RESTRICTIONS_NO_SETUP"/>
diff --git a/res/layout/favorite_fragment.xml b/res/layout/favorite_fragment.xml
index bc8611f9..d2747006 100644
--- a/res/layout/favorite_fragment.xml
+++ b/res/layout/favorite_fragment.xml
@@ -16,6 +16,7 @@
-->
<FrameLayout
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">
@@ -46,10 +47,11 @@
android:layout_height="@dimen/touch_target_size"
android:text="@string/add_favorite_button"
android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/hero_button_text_color"
android:background="@drawable/hero_button_background"
- android:paddingStart="@dimen/favorite_add_button_padding"
- android:paddingEnd="@dimen/favorite_add_button_padding"
- android:gravity="center"/>
+ android:paddingHorizontal="@dimen/favorite_add_button_padding"
+ android:gravity="center"
+ app:carUxRestrictions="UX_RESTRICTIONS_NO_SETUP"/>
</LinearLayout>
diff --git a/res/layout/no_hfp.xml b/res/layout/no_hfp.xml
index ae24f353..0ec017e0 100644
--- a/res/layout/no_hfp.xml
+++ b/res/layout/no_hfp.xml
@@ -49,10 +49,8 @@
<TextView
android:id="@id/error_string"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ style="@style/FullScreenErrorMessageStyle"
android:text="@string/no_hfp"
- style="@style/NoHfpText"
app:layout_constraintTop_toBottomOf="@id/error_icon"
app:layout_constraintBottom_toTopOf="@+id/connect_bluetooth_button"
app:layout_constraintStart_toStartOf="parent"
@@ -60,14 +58,8 @@
<com.android.car.apps.common.UxrButton
android:id="@+id/connect_bluetooth_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ style="@style/FullScreenErrorButtonStyle"
android:text="@string/connect_bluetooth_button_text"
- android:minWidth="@dimen/connect_bluetooth_button_min_width"
- android:minHeight="@dimen/connect_bluetooth_button_min_height"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:background="@drawable/hero_button_background"
- app:carUxRestrictions="UX_RESTRICTIONS_FULLY_RESTRICTED"
android:layout_marginTop="@dimen/connect_bluetooth_button_margin_top"
app:layout_constraintTop_toBottomOf="@+id/error_string"
app:layout_constraintBottom_toBottomOf="parent"
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 7286bf54..f1aa7b0f 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -39,7 +39,6 @@
<color name="secondary_icon_color">@color/secondary_icon_color_light</color>
<color name="secondary_icon_color_dark">#8ADADCE0</color>
<color name="secondary_icon_color_light">#99FFFFFF</color>
- <color name="hero_button_background_color">@*android:color/car_grey_868</color>
<color name="add_favorite_background_color">@*android:color/car_grey_868</color>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 79f9755e..b70841d8 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -120,8 +120,6 @@
<dimen name="no_hfp_icon_size">56dp</dimen>
<dimen name="emergency_button_min_height">@dimen/touch_target_size</dimen>
<dimen name="emergency_button_min_width">@dimen/touch_target_width</dimen>
- <dimen name="connect_bluetooth_button_min_height">@dimen/touch_target_size</dimen>
- <dimen name="connect_bluetooth_button_min_width">@dimen/touch_target_width</dimen>
<dimen name="emergency_button_bottom_margin">@*android:dimen/car_padding_4</dimen>
<dimen name="no_hfp_icon_margin_bottom">@*android:dimen/car_padding_3</dimen>
<dimen name="connect_bluetooth_button_margin_top">@*android:dimen/car_padding_5</dimen>
@@ -144,7 +142,6 @@
<dimen name="primary_icon_enclosing_circle_size">64dp</dimen>
<dimen name="inline_icon_size">24dp</dimen>
<dimen name="preference_list_margin">@*android:dimen/car_margin</dimen>
- <dimen name="hero_button_corner_radius">38dp</dimen>
<dimen name="contact_avatar_corner_radius_percent" format="float">0.5</dimen>
<dimen name="touch_target_width">156dp</dimen>
<dimen name="subheader_list_height">76dp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 5b2ecde6..0b63e8af 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -62,12 +62,6 @@
<item name="android:tint">@color/primary_icon_color</item>
</style>
- <style name="NoHfpText">
- <item name="android:textAppearance">?android:attr/textAppearanceLarge</item>
- <item name="android:gravity">center</item>
- <item name="android:maxLines">3</item>
- </style>
-
<!--TODO: fix it system wide instead of creating override-->
<style name="Widget.Dialer.Toolbar" parent="*android:Widget.DeviceDefault.Toolbar">
<!-- No padding for navigation button which is car_margin wide -->