From ef02e3e5f4080a894650a550b1fa3d9e7bd7e8c1 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 3 Feb 2021 14:43:58 -0800 Subject: [PATCH] Create ux restricted customizations for DeviceDefault buttons and switches In automotive, onscreen components can be "ux restricted", which means you can't use them at the moment for safety reasons, for example while driving. Make DeviceDefaults buttons and switches visually change to indicate to the user that they are ux restricted. Fixes: 178644245 Test: Manually Change-Id: I5bccf4c0331fa496be9b90fb41381c9b674bf237 --- .../car_borderless_button_text_color.xml | 1 + core/res/res/color-car/car_switch_track.xml | 27 +++++++++++++++++++ .../drawable-car/car_button_background.xml | 22 +++++++++++++++ .../res/res/drawable-car/car_switch_track.xml | 2 +- core/res/res/values/attrs_car.xml | 24 +++++++++++++++++ 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 core/res/res/color-car/car_switch_track.xml create mode 100644 core/res/res/values/attrs_car.xml diff --git a/core/res/res/color-car/car_borderless_button_text_color.xml b/core/res/res/color-car/car_borderless_button_text_color.xml index 1cdd6cd901af2..0a86e4012e998 100644 --- a/core/res/res/color-car/car_borderless_button_text_color.xml +++ b/core/res/res/color-car/car_borderless_button_text_color.xml @@ -16,5 +16,6 @@ limitations under the License. + diff --git a/core/res/res/color-car/car_switch_track.xml b/core/res/res/color-car/car_switch_track.xml new file mode 100644 index 0000000000000..8ca67dd8dda90 --- /dev/null +++ b/core/res/res/color-car/car_switch_track.xml @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/core/res/res/drawable-car/car_button_background.xml b/core/res/res/drawable-car/car_button_background.xml index e568aebfe81d4..13b0ec13f3559 100644 --- a/core/res/res/drawable-car/car_button_background.xml +++ b/core/res/res/drawable-car/car_button_background.xml @@ -25,6 +25,22 @@ limitations under the License. android:color="#0059B3"/> + + + + + + + + + + + + + + @@ -47,6 +63,12 @@ limitations under the License. + + + + + + diff --git a/core/res/res/drawable-car/car_switch_track.xml b/core/res/res/drawable-car/car_switch_track.xml index cb0b9beeeab6f..51e9f7eb4ebc9 100644 --- a/core/res/res/drawable-car/car_switch_track.xml +++ b/core/res/res/drawable-car/car_switch_track.xml @@ -41,7 +41,7 @@ android:right="@dimen/car_switch_track_margin_size"> + android:tint="@color/car_switch_track"> diff --git a/core/res/res/values/attrs_car.xml b/core/res/res/values/attrs_car.xml new file mode 100644 index 0000000000000..6bfea9728b696 --- /dev/null +++ b/core/res/res/values/attrs_car.xml @@ -0,0 +1,24 @@ + + + + + + + +