Parameterize scrim color into theme attribute.

Modify FAB Transformation to use theme attribute rather than hardcoded value.
Fix scrim's alpha value to actually reflect 32% black.

PiperOrigin-RevId: 169620100
This commit is contained in:
markwei 2017-09-21 19:41:28 -04:00 committed by Miguel Yanez Barreto
parent 50b4dc51cf
commit d78b8b4f72
3 changed files with 13 additions and 1 deletions

View File

@ -43,6 +43,10 @@
resource. -->
<attr name="colorPaletteSecondary" format="reference"/>
<!-- The scrim background that appears below modals and expanded navigation menus.
The background can either be a color or a bitmap drawable with tileMode set to repeat. -->
<attr name="scrimBackground" format="color|reference"/>
<!-- TODO: Need to audit these attributes to see if they are useful. -->
<attr name="colorMaterialControl" format="color"/>
<attr name="colorMaterialControlHighlight" format="color"/>

View File

@ -56,5 +56,5 @@
<color name="mtrl_text_btn_bg_color_pressed">#48191919</color>
<!-- 32% opacity black -->
<color name="mtrl_scrim_color">#82000000</color>
<color name="mtrl_scrim_color">#52000000</color>
</resources>

View File

@ -47,6 +47,8 @@
<item name="colorPalettePrimary">@array/design_default_color_palette_primary</item>
<item name="colorPaletteSecondary">@array/design_default_color_palette_secondary</item>
<item name="scrimBackground">@color/mtrl_scrim_color</item>
</style>
<style name="Base.V14.Theme.MaterialComponents.Light" parent="Platform.MaterialComponents.Light">
@ -62,6 +64,8 @@
<item name="colorPalettePrimary">@array/design_default_color_palette_primary</item>
<item name="colorPaletteSecondary">@array/design_default_color_palette_secondary</item>
<item name="scrimBackground">@color/mtrl_scrim_color</item>
</style>
<style name="Base.V14.Theme.MaterialComponents.Dialog" parent="Platform.MaterialComponents.Dialog">
@ -77,6 +81,8 @@
<item name="colorPalettePrimary">@array/design_default_color_palette_primary</item>
<item name="colorPaletteSecondary">@array/design_default_color_palette_secondary</item>
<item name="scrimBackground">@color/mtrl_scrim_color</item>
</style>
<style name="Base.V14.Theme.MaterialComponents.Light.Dialog" parent="Platform.MaterialComponents.Light.Dialog">
@ -92,6 +98,8 @@
<item name="colorPalettePrimary">@array/design_default_color_palette_primary</item>
<item name="colorPaletteSecondary">@array/design_default_color_palette_secondary</item>
<item name="scrimBackground">@color/mtrl_scrim_color</item>
</style>
<!-- Themes in the "Base.Theme" family vary based on the current platform