-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Description:
When using MaterialShapeDrawable.createWithElevationOverlay() and adding it as the background to a view, it doesn't apply the semi-transparent overlay to indicate elevation if colorOnSurface is a color state list resource.
The test app has a night theme with colorOnSurface reference to a color state list resource that is used to set the alpha on a color:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="0.87" android:color="#fff" />
</selector>
There are 2 TextViews and they both have a MaterialShapeDrawable set as their background. The second one uses a theme overlay to illustrate the elevation overlay working with an argb color set as colorOnSurface.
<style name="ThemeOverlay.App.White87ARGB" parent="ThemeOverlay.MaterialComponents">
<item name="colorOnSurface">#DEFFFFFF</item>
</style>
Expected behavior:
The background of colorOnSurface: @color/white_87 should match colorOnSurface: #DEFFFFFF.
Source code:
https://github.com/claytongreen/elevation_overlay_bug
Android API version: 29
Material Library version: 1.2.0-alpha04
Device: API 29 Pixel 3 emulator
