Update App Header background/foreground style
Adds support for additional background and foreground color changes
based on system theme, app theme, focused state and default vs custom
headers. There are 16 different style variations to apply, so some
additional changes were made to make this possible and more readable.
Changes include:
1) Default header background drawable is now composed of two layers:
backLayer - may be solid white, back or null. Black/white is needed
when the frontLayer is semi transparent, to avoid showing app content
behind it.
fronLayer - usually a solid color (material token) with full opacity,
but may have some transparency to differentiate between focused and
unfocused windows that are all forced to use the inverse_surface color
token, which happens when the system and app's light/dark theme do not
match (e.g. dark app on light system theme)
2) New Header data class that holds the TaskInfo/System properties that
have an effect on which style is applied.
3) New HeaderStyle data class, to represent the resulting
background/foreground configuration calculated based on the Header
and that will be applied to the view hierarchy.
4) Replaces the Maximize button's default background ripple with a
custom RippleDrawable, to allow defining selector states with
different color/alpha combinations.
Flag: com.android.window.flags.enable_themed_app_headers
Bug: 328668781
Bug: 336555032
Test: try all combinations of app states, verify styles
Change-Id: I5f08e66ecccb5909a6a714937af1370021a934fe
5 files changed