From 9242e6ee6a029a01635eb482b719dcd4d99fa157 Mon Sep 17 00:00:00 2001 From: Danny Epstein Date: Wed, 2 Dec 2020 18:30:32 -0800 Subject: [PATCH] DO NOT MERGE Use round highlight for navigation buttons Make the focus highlight and touch ripple for buttons in the navigation bar be round rather than square. Also fix a bug in the dimming logic. The alpha was applied to the icon initially, but when the state changed, the alpha was applied to the entire button. Launcher in master is quite different so it this change is limited to rvc-qpr-dev for now. Test: manual Bug: 174614908 Bug: 168317872 Change-Id: I9b80946887ad85a73ddd281f7afcc9fcc8280a64 --- .../res/drawable/navigation_bar_button_bg.xml | 34 +++++++++++++++++++ packages/CarSystemUI/res/values/styles.xml | 2 +- .../navigationbar/CarNavigationButton.java | 3 +- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 packages/CarSystemUI/res/drawable/navigation_bar_button_bg.xml diff --git a/packages/CarSystemUI/res/drawable/navigation_bar_button_bg.xml b/packages/CarSystemUI/res/drawable/navigation_bar_button_bg.xml new file mode 100644 index 0000000000000..848c7fa95737d --- /dev/null +++ b/packages/CarSystemUI/res/drawable/navigation_bar_button_bg.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + diff --git a/packages/CarSystemUI/res/values/styles.xml b/packages/CarSystemUI/res/values/styles.xml index e76373d4a4f7b..648dc16626c73 100644 --- a/packages/CarSystemUI/res/values/styles.xml +++ b/packages/CarSystemUI/res/values/styles.xml @@ -40,6 +40,6 @@ \ No newline at end of file diff --git a/packages/CarSystemUI/src/com/android/systemui/car/navigationbar/CarNavigationButton.java b/packages/CarSystemUI/src/com/android/systemui/car/navigationbar/CarNavigationButton.java index e7e33a5439f9f..ddd261a4c0180 100644 --- a/packages/CarSystemUI/src/com/android/systemui/car/navigationbar/CarNavigationButton.java +++ b/packages/CarSystemUI/src/com/android/systemui/car/navigationbar/CarNavigationButton.java @@ -99,7 +99,8 @@ public class CarNavigationButton extends LinearLayout { if (mHighlightWhenSelected) { // Always apply selected alpha if the button does not toggle alpha based on selection // state. - setAlpha(!mHighlightWhenSelected || mSelected ? mSelectedAlpha : mUnselectedAlpha); + mIcon.setAlpha( + !mHighlightWhenSelected || mSelected ? mSelectedAlpha : mUnselectedAlpha); } if (mShowMoreWhenSelected && mMoreIcon != null) { mMoreIcon.setVisibility(selected ? VISIBLE : GONE);