Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 853ae8c6 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

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
parent c119ee1e
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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();
    }