summaryrefslogtreecommitdiff
path: root/libs/androidfw/misc.cpp
diff options
context:
space:
mode:
author Julia Tuttle <juliatuttle@google.com> 2023-11-18 05:07:48 -0500
committer Julia Tuttle <juliatuttle@google.com> 2023-11-21 14:58:24 -0500
commita47ea5ec42337124cfa1e72ee1d2ce12f486abdc (patch)
treeacc42ce3d868870ec70d4eb5f1e1adbf295d43d8 /libs/androidfw/misc.cpp
parent66461b5b123521ca9c4504e5fbce53294086df78 (diff)
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
Diffstat (limited to 'libs/androidfw/misc.cpp')
0 files changed, 0 insertions, 0 deletions