Skip to content

Commit

Permalink
[M3][Theme] Add isMaterial3Theme attr and set to true in 4 main Mater…
Browse files Browse the repository at this point in the history
…ial3 themes

PiperOrigin-RevId: 392677525
  • Loading branch information
dsn5ft authored and leticiarossi committed Aug 24, 2021
1 parent 1cf724b commit 8670643
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
Theme.MaterialComponents.Bridge theme. -->
<attr name="isMaterialTheme" format="boolean"/>

<!-- Internal flag used to denote that a theme is a Theme.Material3 theme. -->
<attr name="isMaterial3Theme" format="boolean"/>

<!-- When set to true, the material selection controls will tint themselves according to
Material Theme colors. When set to false, Material Theme colors will
be ignored. This value should be set to false when using custom drawables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<eat-comment/>

<style name="Base.V14.Theme.Material3.Light.Dialog" parent="Theme.MaterialComponents.Light.Dialog">
<item name="isMaterial3Theme">true</item>

<!-- Color palettes -->
<item name="colorPrimary">@color/m3_sys_color_light_primary</item>
<item name="colorPrimaryDark">?attr/colorPrimary</item>
Expand Down Expand Up @@ -133,6 +135,8 @@
</style>

<style name="Base.V14.Theme.Material3.Dark.Dialog" parent="Theme.MaterialComponents.Dialog">
<item name="isMaterial3Theme">true</item>

<!-- Color palettes -->
<item name="colorPrimary">@color/m3_sys_color_dark_primary</item>
<item name="colorPrimaryDark">?attr/colorPrimary</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<eat-comment/>

<style name="Base.V14.Theme.Material3.Light" parent="Theme.MaterialComponents.Light">
<item name="isMaterial3Theme">true</item>

<!-- Color palettes -->
<item name="colorPrimary">@color/m3_sys_color_light_primary</item>
<item name="colorPrimaryDark">?attr/colorPrimary</item>
Expand Down Expand Up @@ -144,6 +146,8 @@
</style>

<style name="Base.V14.Theme.Material3.Dark" parent="Theme.MaterialComponents">
<item name="isMaterial3Theme">true</item>

<!-- Color palettes -->
<item name="colorPrimary">@color/m3_sys_color_dark_primary</item>
<item name="colorPrimaryDark">?attr/colorPrimary</item>
Expand Down

0 comments on commit 8670643

Please sign in to comment.