Restore the notification background's hovered/pressed tints
As far as I know, NotificationBackgroundView always has the "custom background" set to R.drawable.notification_material_bg, which is a layer-list with two layers: The bottom layer is the real notification background color, which (at the moment) defaults to materialColorSurfaceContainerHigh, and should be replaced with the tint color if the notification is colorized. The top layer is a selector that blends in a state-dependent amount of the notification foreground color, which (at the moment) defaults to materialColorOnSurface, and should be replaced with the calculated foreground color if the notification is colorized. This is what gives the notification background's default, hovered, and pressed states a distinct appearance. Right now, neither of those things are happening. At first, we were tinting the entire LayerDrawable with the tint color, but *only when not hovered or pressed*, so the notification would de-colorize when hovered or pressed. I "fixed" that in ag/25397894 by tinting it in all three states, but then the default, hovered, and pressed states became indistinguishable. This change specifically updates only the *bottom* layer with a colorized notification's background color, so the default, hovered, and pressed states are all colorized *and* distinguishable. This change does *not* update the *top* layer with a colorized notification's *foreground* color, which would result in more distinguishable states for some color situations, but would also require much more plumbing of colors. Bug: 277285099 Bug: 310318993 Test: manual: observe default/hovered/pressed states of colorized notif Flag: NA Change-Id: Ie2d256fa73155647742293f8fc5db33a2053db8b
Loading
Please register or sign in to comment