Skip to content

Commit f1d1ab7

Browse files
neobuddy89joeyhuab
authored andcommitted
SystemUI: Fix notification flicker with transluency enabled
Test: Screen record notification will flicker on expansion. Reason: Override tint color was reset on expansion. Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
1 parent 2c8b3c2 commit f1d1ab7

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,6 @@ protected void updateColors() {
166166
R.color.notification_ripple_tinted_color);
167167
mNormalRippleColor = mContext.getColor(
168168
R.color.notification_ripple_untinted_color);
169-
// Reset background color tint and override tint, as they are from an old theme
170-
mBgTint = NO_COLOR;
171-
mOverrideTint = NO_COLOR;
172-
mOverrideAmount = 0.0f;
173169
}
174170

175171
/**
@@ -306,8 +302,7 @@ void setTintColor(int color, boolean animated) {
306302
public void setOverrideTintColor(int color, float overrideAmount) {
307303
mOverrideTint = color;
308304
mOverrideAmount = overrideAmount;
309-
int newColor = calculateBgColor();
310-
setBackgroundTintColor(newColor);
305+
updateBackgroundTint(false /* animated */);
311306
}
312307

313308
protected void updateBackgroundTint() {
@@ -773,11 +768,11 @@ private int calculateBgColor(boolean withTint, boolean withOverride) {
773768
}
774769

775770
private int getRippleColor() {
776-
if (mBgTint != 0) {
777-
return mTintedRippleColor;
778-
} else {
779-
return mNormalRippleColor;
780-
}
771+
final boolean hasExplicitTint =
772+
mBgTint != NO_COLOR
773+
|| (mOverrideTint != NO_COLOR && mOverrideAmount > 0f);
774+
775+
return hasExplicitTint ? mTintedRippleColor : mNormalRippleColor;
781776
}
782777

783778
/**

packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ public NotificationBackgroundView(Context context, AttributeSet attrs) {
100100

101101
/** Sets whether blur/translucency is supported for notification rows. */
102102
public void setIsBlurSupported(boolean isBlurSupported) {
103-
mIsBlurSupported = isBlurSupported;
104-
// Re-apply PorterDuff on blur changes.
105-
if (mBackground != null) {
106-
setTint(mTintColor);
103+
if (mIsBlurSupported != isBlurSupported) {
104+
mIsBlurSupported = isBlurSupported;
105+
setStatefulColors();
106+
invalidate();
107107
}
108108
}
109109

0 commit comments

Comments
 (0)