diff options
| author | 2020-12-04 20:55:45 +0000 | |
|---|---|---|
| committer | 2020-12-04 20:55:45 +0000 | |
| commit | 99fe8f3059016794c4573cac41f8593fbe451622 (patch) | |
| tree | c051f7300cf51a06cd8574f9ddff5dbf62d7d7d9 | |
| parent | f05bfa9149f54acf22c2c92dc7202e14be344ebf (diff) | |
| parent | 9242e6ee6a029a01635eb482b719dcd4d99fa157 (diff) | |
Merge "DO NOT MERGE Use round highlight for navigation buttons" into rvc-qpr-dev
3 files changed, 37 insertions, 2 deletions
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 000000000000..848c7fa95737 --- /dev/null +++ b/packages/CarSystemUI/res/drawable/navigation_bar_button_bg.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 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. + --> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_focused="true"> + <shape android:shape="oval"> + <solid android:color="@color/car_ui_rotary_focus_fill_color"/> + <stroke android:width="@dimen/car_ui_rotary_focus_stroke_width" + android:color="@color/car_ui_rotary_focus_stroke_color"/> + </shape> + </item> + <item> + <ripple android:color="@color/car_ui_ripple_color"> + <item android:id="@android:id/mask"> + <shape android:shape="oval"> + <solid android:color="@android:color/white"/> + </shape> + </item> + </ripple> + </item> +</selector> diff --git a/packages/CarSystemUI/res/values/styles.xml b/packages/CarSystemUI/res/values/styles.xml index e76373d4a4f7..648dc16626c7 100644 --- a/packages/CarSystemUI/res/values/styles.xml +++ b/packages/CarSystemUI/res/values/styles.xml @@ -40,6 +40,6 @@ <style name="NavigationBarButton"> <item name="android:layout_height">96dp</item> <item name="android:layout_width">96dp</item> - <item name="android:background">?android:attr/selectableItemBackground</item> + <item name="android:background">@drawable/navigation_bar_button_bg</item> </style> </resources>
\ 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 e7e33a5439f9..ddd261a4c018 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); |