summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dave Mankoff <mankoff@google.com> 2020-05-29 14:25:05 -0400
committer Dave Mankoff <mankoff@google.com> 2020-05-29 14:25:05 -0400
commit853ae8c67e53d8fe0acc37ae78631f7adacf5dcd (patch)
treeaedde396e9b72f24f9019cbc95b0b25a614d4139
parentc119ee1ed2c70727b786bdbbfaec0776b45cb4a0 (diff)
Add color change listener to NSSL
Adds a ColorExtractor.OnColorsChangedListener to the NotificiationStackScrollLayout. Move some of the related code from onThemeChanged to the new listener so that it gets all the same calls that the ScrimController gets when the wallpaper changes. Bug: 150143437 Test: manual Change-Id: I687f606ea28e699dc46df8c08af13010c41d6ae2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index a877bc1c4205..41f959c699e4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -535,6 +535,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
private int mWaterfallTopInset;
+ private SysuiColorExtractor.OnColorsChangedListener mOnColorsChangedListener =
+ (colorExtractor, which) -> {
+ final boolean useDarkText = mColorExtractor.getNeutralColors().supportsDarkText();
+ updateDecorViews(useDarkText);
+ };
+
@Inject
public NotificationStackScrollLayout(
@Named(VIEW_CONTEXT) Context context,
@@ -662,6 +668,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
mStatusbarStateController = statusBarStateController;
initializeForegroundServiceSection(fgsFeatureController);
mUiEventLogger = uiEventLogger;
+ mColorExtractor.addOnColorsChangedListener(mOnColorsChangedListener);
}
private void initializeForegroundServiceSection(
@@ -728,9 +735,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
@Override
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
public void onThemeChanged() {
- final boolean useDarkText = mColorExtractor.getNeutralColors().supportsDarkText();
- updateDecorViews(useDarkText);
-
updateFooter();
}