From 853ae8c67e53d8fe0acc37ae78631f7adacf5dcd Mon Sep 17 00:00:00 2001 From: Dave Mankoff Date: Fri, 29 May 2020 14:25:05 -0400 Subject: 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 --- .../notification/stack/NotificationStackScrollLayout.java | 10 +++++++--- 1 file 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(); } -- cgit v1.2.3-59-g8ed1b