Skip to content

Commit dac9bf3

Browse files
drchenleticiarossi
authored andcommitted
[M3][Color] Set android:windowBackground to android:colorBackground
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
1 parent 672e744 commit dac9bf3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/java/com/google/android/material/theme/res/values/themes_base.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
<item name="colorErrorContainer">@color/m3_sys_color_light_error_container</item>
5252
<item name="colorOnErrorContainer">@color/m3_sys_color_light_on_error_container</item>
5353

54+
<!-- Framework Colors. -->
55+
<item name="android:windowBackground">?android:attr/colorBackground</item>
56+
5457
<!-- Default Framework Text Colors. -->
5558
<item name="android:textColorPrimary">@color/m3_default_color_primary_text</item>
5659
<item name="android:textColorPrimaryInverse">@color/m3_dark_default_color_primary_text</item>
@@ -245,6 +248,9 @@
245248
<item name="colorErrorContainer">@color/m3_sys_color_dark_error_container</item>
246249
<item name="colorOnErrorContainer">@color/m3_sys_color_dark_on_error_container</item>
247250

251+
<!-- Framework Colors. -->
252+
<item name="android:windowBackground">?android:attr/colorBackground</item>
253+
248254
<!-- Default Framework Text Colors. -->
249255
<item name="android:textColorPrimary">@color/m3_dark_default_color_primary_text</item>
250256
<item name="android:textColorPrimaryInverse">@color/m3_default_color_primary_text</item>

0 commit comments

Comments
 (0)