diff --git a/core/java/com/android/internal/widget/EmphasizedNotificationButton.java b/core/java/com/android/internal/widget/EmphasizedNotificationButton.java index 4460e4a0ea781..ce6af49eef0be 100644 --- a/core/java/com/android/internal/widget/EmphasizedNotificationButton.java +++ b/core/java/com/android/internal/widget/EmphasizedNotificationButton.java @@ -40,6 +40,7 @@ import com.android.internal.R; @RemoteViews.RemoteView public class EmphasizedNotificationButton extends Button { private final RippleDrawable mRipple; + private final GradientDrawable mBackground; private boolean mPriority; public EmphasizedNotificationButton(Context context) { @@ -57,9 +58,10 @@ public class EmphasizedNotificationButton extends Button { public EmphasizedNotificationButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); - DrawableWrapper background = (DrawableWrapper) getBackground().mutate(); - mRipple = (RippleDrawable) background.getDrawable(); + mRipple = (RippleDrawable) getBackground(); mRipple.mutate(); + DrawableWrapper inset = (DrawableWrapper) mRipple.getDrawable(0); + mBackground = (GradientDrawable) inset.getDrawable(); } @RemotableViewMethod @@ -70,8 +72,7 @@ public class EmphasizedNotificationButton extends Button { @RemotableViewMethod public void setButtonBackground(ColorStateList color) { - GradientDrawable inner = (GradientDrawable) mRipple.getDrawable(0); - inner.setColor(color); + mBackground.setColor(color); invalidate(); } diff --git a/core/res/res/drawable/btn_notification_emphasized.xml b/core/res/res/drawable/btn_notification_emphasized.xml index 63707ab7f5d69..29c51f2a33c94 100644 --- a/core/res/res/drawable/btn_notification_emphasized.xml +++ b/core/res/res/drawable/btn_notification_emphasized.xml @@ -15,13 +15,13 @@ ~ limitations under the License --> - - - + + + - - - + + +