Restored hover states for notifications
Hover state colours were being interfered with by tintColor. They've now
being restored to work as originally intended without tintColor
ag/24745369. At the same time, pressed state stay suppressed - adding
tintColor to pressed state makes them indistinguishable from NO_STATE.
We're choosing to leave pressed state suppressed because of bugs
introduced by not suppressing it b/309221765.
A more permanent fix for this will be tracked in this issue b/313920497
Test: manual testing -> start swiping on notification -> ensure there is
no flicker. Hover over a notification with a mouse -> ensure hover
effect occurs as defined in uX Specs here go/notifications-hover-prototype
Fixes: 309221765
Flag: NA
Change-Id: Ibcfd9d243b2d3ba9816aff754331938d6b9c2390
diff --git a/packages/SystemUI/res/color/notification_overlay_color.xml b/packages/SystemUI/res/color/notification_overlay_color.xml
index c24bff9..a14a7ad 100644
--- a/packages/SystemUI/res/color/notification_overlay_color.xml
+++ b/packages/SystemUI/res/color/notification_overlay_color.xml
@@ -17,7 +17,9 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
- <item android:state_pressed="true" android:color="?androidprv:attr/materialColorOnSurface" android:alpha="0.15" />
+ <!-- Pressed state's alpha is set to 0.00 temporarily until this bug is resolved permanently
+ b/313920497 Design intended alpha is 0.15-->
+ <item android:state_pressed="true" android:color="?androidprv:attr/materialColorOnSurface" android:alpha="0.00" />
<item android:state_hovered="true" android:color="?androidprv:attr/materialColorOnSurface" android:alpha="0.11" />
<item android:color="@color/transparent" />
</selector>
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java
index 8eda96f..f6431a2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java
@@ -156,7 +156,7 @@
new int[]{com.android.internal.R.attr.state_hovered},
new int[]{}},
- new int[]{tintColor, tintColor, tintColor}
+ new int[]{tintColor, 0, tintColor}
);
mBackground.setTintMode(PorterDuff.Mode.SRC_ATOP);
mBackground.setTintList(stateList);