From 588423a00f23511dcb451a44f0ff687c6db1e2d0 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 17 Aug 2017 16:42:51 -0700 Subject: [PATCH] Fixed a bug where the colorization was lost when reinflating Because we're reloading the drawable, it's colorfilter was lost. Let's make sure we're reapplying any tints that we had when doing so. Test: add colorized notification, reinflate Change-Id: I11e59636317eb65da5573529f0dd44571ca10cce Fixes: 63901744 --- .../systemui/statusbar/NotificationBackgroundView.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java index 194cdc77c02a2..81a99bc1e70c4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java @@ -19,6 +19,7 @@ package com.android.systemui.statusbar; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Canvas; +import android.graphics.ColorFilter; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; @@ -34,6 +35,7 @@ public class NotificationBackgroundView extends View { private int mClipTopAmount; private int mActualHeight; private int mClipBottomAmount; + private int mTintColor; public NotificationBackgroundView(Context context, AttributeSet attrs) { super(context, attrs); @@ -87,6 +89,7 @@ public class NotificationBackgroundView extends View { mBackground = background; if (mBackground != null) { mBackground.setCallback(this); + setTint(mTintColor); } if (mBackground instanceof RippleDrawable) { ((RippleDrawable) mBackground).setForceSoftware(true); @@ -105,6 +108,7 @@ public class NotificationBackgroundView extends View { } else { mBackground.clearColorFilter(); } + mTintColor = tintColor; invalidate(); }