Skip to content

Commit

Permalink
[M3][Color] Set android:windowBackground to android:colorBackground
Browse files Browse the repository at this point in the history
The same remapping is done on API 21+ by framework base themes. On API levels lower than 21, AppCompat base themes "backport" the behavior to map window background to a separate color resources. With Material 3 we want a consistent and clear behavior, this CL explicitly remaps android:windowBackground to android:colorBackground so the behavior will be the same across all API levels.

PiperOrigin-RevId: 417711790
  • Loading branch information
drchen authored and leticiarossi committed Dec 22, 2021
1 parent 672e744 commit dac9bf3
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -51,6 +51,9 @@
<item name="colorErrorContainer">@color/m3_sys_color_light_error_container</item>
<item name="colorOnErrorContainer">@color/m3_sys_color_light_on_error_container</item>

<!-- Framework Colors. -->
<item name="android:windowBackground">?android:attr/colorBackground</item>

<!-- Default Framework Text Colors. -->
<item name="android:textColorPrimary">@color/m3_default_color_primary_text</item>
<item name="android:textColorPrimaryInverse">@color/m3_dark_default_color_primary_text</item>
Expand Down Expand Up @@ -245,6 +248,9 @@
<item name="colorErrorContainer">@color/m3_sys_color_dark_error_container</item>
<item name="colorOnErrorContainer">@color/m3_sys_color_dark_on_error_container</item>

<!-- Framework Colors. -->
<item name="android:windowBackground">?android:attr/colorBackground</item>

<!-- Default Framework Text Colors. -->
<item name="android:textColorPrimary">@color/m3_dark_default_color_primary_text</item>
<item name="android:textColorPrimaryInverse">@color/m3_default_color_primary_text</item>
Expand Down

0 comments on commit dac9bf3

Please sign in to comment.