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

Commit 022c490d authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[Central Surfaces] Make NotificationPanelView a singleton.

Bug: 277762009
Test: compiles; shade works
Change-Id: I69cadfeb95892105784fcf4718a3ba9b5e13298f
parent 8816c72a
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -84,10 +84,6 @@ public class NotificationShadeWindowView extends FrameLayout {
        setMotionEventSplittingEnabled(false);
    }

    public NotificationPanelView getNotificationPanelView() {
        return findViewById(R.id.notification_panel);
    }

    @Override
    public WindowInsets onApplyWindowInsets(WindowInsets windowInsets) {
        final Insets insets = windowInsets.getInsetsIgnoringVisibility(systemBars());
+9 −0
Original line number Diff line number Diff line
@@ -50,5 +50,14 @@ abstract class ShadeModule {
        ): NotificationStackScrollLayout {
            return notificationShadeWindowView.findViewById(R.id.notification_stack_scroller)
        }

        // TODO(b/277762009): Only allow this view's controller to inject the view. See above.
        @Provides
        @SysUISingleton
        fun providesNotificationPanelView(
            notificationShadeWindowView: NotificationShadeWindowView,
        ): NotificationPanelView {
            return notificationShadeWindowView.findViewById(R.id.notification_panel)
        }
    }
}
+0 −8
Original line number Diff line number Diff line
@@ -134,14 +134,6 @@ public abstract class StatusBarViewModule {
        }
    }

    /** */
    @Provides
    @CentralSurfacesComponent.CentralSurfacesScope
    public static NotificationPanelView getNotificationPanelView(
            NotificationShadeWindowView notificationShadeWindowView) {
        return notificationShadeWindowView.getNotificationPanelView();
    }

    /** */
    @Binds
    @CentralSurfacesComponent.CentralSurfacesScope