diff options
author | Jeff DeCew <jeffdq@google.com> | 2021-05-19 20:14:11 -0400 |
---|---|---|
committer | Jeff DeCew <jeffdq@google.com> | 2021-05-25 09:57:11 -0400 |
commit | cab7d8e0116066ad5f1d00e6a47ad1a65bf6dd80 (patch) | |
tree | 0cbc86e596a98c66e64abb9634b3fc5cd5842956 /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
parent | d49a40998aa13d4bc8ffbfd7893c9198b7727f8a (diff) |
Resolve Notification.Colors once, instead of lazily.
* Instead of resolving colors as-needed, resolve the entire palette potentially used by the notification at the start.
* Centralize color logic and palette storage into Notification.Colors for easier unit testing.
* Adds unit tests for the Notification.Colors, including validating color contrast ratios for various colors.
* Fix a bug with ColorContrastUtil where the luminosity for dark/light font cutoff was 0.5, which resulted in a max contrast ratio of 1.9 for some colors. Now contrast ratios of 4.5:1 can be achieved for all colors.
* Removes a few of the color accessors in Notification.Builder which were infrequently used, and replaces them with direct use of Notification.Colors.
* Notification specific colors (primary, secondary, default) have only been used by colorized notifications for a few months. Remove the dark mode overrides of these, ensuring that colorized notifications have the same exact appearance in light and dark themes.
* Replace the use of the "default" color with the "secondary text color"; this practically only affects the alerted bell icon, is more consistent, and reduces complexity.
Fixes: 187881776
Test: manual
Test: atest android.app.NotificationTest
Change-Id: Ib8840d04093094c324d8bdce5b2e84c93a94db8d
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions