Fix AppBar lift state when snapped (#6103)

status bar foreground alpha is now handled separately
This commit is contained in:
Ivan Iskandar
2021-10-16 09:09:19 +07:00
committed by GitHub
parent b4490e209b
commit 55a3094a65
3 changed files with 84 additions and 43 deletions

View File

@@ -0,0 +1,10 @@
package com.google.android.material.shape
/**
* Use this instead of [MaterialShapeDrawable.getAlpha].
*
* https://github.com/material-components/material-components-android/issues/1796
*/
fun MaterialShapeDrawable.getStateAlpha(): Int {
return (constantState as? MaterialShapeDrawable.MaterialShapeDrawableState)?.alpha ?: alpha
}