diff --git a/lib/java/com/google/android/material/button/MaterialButtonHelper.java b/lib/java/com/google/android/material/button/MaterialButtonHelper.java index fd5e5c304dc..da666c735d4 100644 --- a/lib/java/com/google/android/material/button/MaterialButtonHelper.java +++ b/lib/java/com/google/android/material/button/MaterialButtonHelper.java @@ -143,11 +143,9 @@ private void updateBackground() { MaterialShapeDrawable materialShapeDrawable = getMaterialShapeDrawable(); if (materialShapeDrawable != null) { materialShapeDrawable.setElevation(elevation); - if (IS_LOLLIPOP) { - // Fix the issue that on Lollipop, when first assigned as View's background, RippleDrawable - // won't/can't propagate states to its content drawable. (It somehow works afterwards.) - materialShapeDrawable.setState(materialButton.getDrawableState()); - } + // Workaround (b/231320562): Setting background will cause drawables wrapped inside a + // RippleDrawable lose their states, we need to reset the state here. + materialShapeDrawable.setState(materialButton.getDrawableState()); } }