Update view colors on onOverlayChanged()
We were re-inflating some views, but not updating the colors everywhere we needed. The Shelf, for example, had wrong background colors during transitions because mNormalColor of notifications above it were kept untouched. Test: visual Fixes: 178804239 Change-Id: Ieae0ceed99fd9c00b570a40438ce8313e481e3a4
This commit is contained in:
@@ -1002,10 +1002,6 @@ public class NotificationShelf extends ActivatableNotificationView implements
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onUiModeChanged() {
|
||||
updateBackgroundColors();
|
||||
}
|
||||
|
||||
public void setController(NotificationShelfController notificationShelfController) {
|
||||
mController = notificationShelfController;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
|
||||
initDimens();
|
||||
}
|
||||
|
||||
protected void updateBackgroundColors() {
|
||||
/**
|
||||
* Reload background colors from resources and invalidate views.
|
||||
*/
|
||||
public void updateBackgroundColors() {
|
||||
updateColors();
|
||||
initBackground();
|
||||
updateBackgroundTint();
|
||||
|
||||
@@ -622,7 +622,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
||||
mBgColor = Utils.getColorAttr(mContext, android.R.attr.colorBackgroundFloating)
|
||||
.getDefaultColor();
|
||||
updateBackgroundDimming();
|
||||
mShelf.onUiModeChanged();
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View child = getChildAt(i);
|
||||
if (child instanceof ActivatableNotificationView) {
|
||||
((ActivatableNotificationView) child).updateBackgroundColors();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ShadeViewRefactor(RefactorComponent.DECORATOR)
|
||||
|
||||
@@ -223,6 +223,7 @@ public class NotificationStackScrollLayoutController {
|
||||
updateShowEmptyShadeView();
|
||||
mView.updateCornerRadius();
|
||||
mView.updateBgColor();
|
||||
mView.updateDecorViews();
|
||||
mView.reinflateViews();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user