2 Commits

Author SHA1 Message Date
isabellekim
36b760d220 Change ripples on MaterialButton to use the alphas provided in the ColorStateList.
RippleDrawable on different API levels will modulate the alphas differently
for the pressed / focused / hovered states. Therefore, in order to get the
desired alphas for pressed / focused / hovered states, we are using the
mtrl_(low|high)_ripple_(pressed|focused|hovered|default)_alpha values which have
been defined to account for the different implementations of RippleDrawable.

This will allow developers to specify different colors for focused vs. pressed if desired.

PiperOrigin-RevId: 255306749
2019-07-03 13:50:29 -04:00
afohrman
ca07e5f616 Create OnChangedListener to respond to ShapeAppearanceModel changes and Shapeable interface, and implement it in Chip.
The OnChangedListener provides a callback that MaterialShapeDrawables can use to invalidate themselves when the associated ShapeAppearanceModel changes. This allows for modifying the ShapeAppearanceModel through the get/setShapeAppearance methods that the Shapeable interface exposes without having to update the client to redraw itself.

PiperOrigin-RevId: 238703600
2019-03-22 16:16:23 -04:00