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

Commit 4dd3824f authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] NotificationsPlaceholderViewModel is SysUiViewModel

Bug: 354270224
Test: manually verified that notifications are shown on the lockscreen
and the shade scene
Flag: com.android.systemui.scene_container

Change-Id: Ifca3afd8813f2f523126d7d2aaa7faf91f18b285
parent e4ec8c40
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import com.android.systemui.keyguard.MigrateClocksToBlueprint
import com.android.systemui.keyguard.ui.composable.modifier.burnInAware
import com.android.systemui.keyguard.ui.viewmodel.AodBurnInViewModel
import com.android.systemui.keyguard.ui.viewmodel.BurnInParameters
import com.android.systemui.lifecycle.rememberViewModel
import com.android.systemui.notifications.ui.composable.ConstrainedNotificationStack
import com.android.systemui.shade.LargeScreenHeaderHelper
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout
@@ -48,7 +49,7 @@ class NotificationSection
@Inject
constructor(
    private val stackScrollView: Lazy<NotificationScrollView>,
    private val viewModel: NotificationsPlaceholderViewModel,
    private val viewModelFactory: NotificationsPlaceholderViewModel.Factory,
    private val aodBurnInViewModel: AodBurnInViewModel,
    sharedNotificationContainer: SharedNotificationContainer,
    sharedNotificationContainerViewModel: SharedNotificationContainerViewModel,
@@ -98,7 +99,7 @@ constructor(

        ConstrainedNotificationStack(
            stackScrollView = stackScrollView.get(),
            viewModel = viewModel,
            viewModel = rememberViewModel { viewModelFactory.create() },
            modifier =
                modifier
                    .fillMaxWidth()
+6 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.compose.animation.scene.UserActionResult
import com.android.systemui.battery.BatteryMeterViewController
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.ui.composable.LockscreenContent
import com.android.systemui.lifecycle.rememberViewModel
import com.android.systemui.notifications.ui.viewmodel.NotificationsShadeSceneActionsViewModel
import com.android.systemui.scene.session.ui.composable.SaveableSession
import com.android.systemui.scene.shared.model.Scenes
@@ -53,7 +54,7 @@ constructor(
    private val actionsViewModelFactory: NotificationsShadeSceneActionsViewModel.Factory,
    private val overlayShadeViewModelFactory: OverlayShadeViewModel.Factory,
    private val shadeHeaderViewModelFactory: ShadeHeaderViewModel.Factory,
    private val notificationsPlaceholderViewModel: NotificationsPlaceholderViewModel,
    private val notificationsPlaceholderViewModelFactory: NotificationsPlaceholderViewModel.Factory,
    private val tintedIconManagerFactory: TintedIconManager.Factory,
    private val batteryMeterViewControllerFactory: BatteryMeterViewController.Factory,
    private val statusBarIconController: StatusBarIconController,
@@ -79,6 +80,10 @@ constructor(
    override fun SceneScope.Content(
        modifier: Modifier,
    ) {
        val notificationsPlaceholderViewModel = rememberViewModel {
            notificationsPlaceholderViewModelFactory.create()
        }

        OverlayShade(
            modifier = modifier,
            viewModelFactory = overlayShadeViewModelFactory,
+3 −2
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ constructor(
    private val shadeSession: SaveableSession,
    private val notificationStackScrollView: Lazy<NotificationScrollView>,
    private val viewModel: QuickSettingsSceneViewModel,
    private val notificationsPlaceholderViewModel: NotificationsPlaceholderViewModel,
    private val notificationsPlaceholderViewModelFactory: NotificationsPlaceholderViewModel.Factory,
    private val tintedIconManagerFactory: TintedIconManager.Factory,
    private val batteryMeterViewControllerFactory: BatteryMeterViewController.Factory,
    private val statusBarIconController: StatusBarIconController,
@@ -140,7 +140,8 @@ constructor(
        QuickSettingsScene(
            notificationStackScrollView = notificationStackScrollView.get(),
            viewModel = viewModel,
            notificationsPlaceholderViewModel = notificationsPlaceholderViewModel,
            notificationsPlaceholderViewModel =
                rememberViewModel { notificationsPlaceholderViewModelFactory.create() },
            createTintedIconManager = tintedIconManagerFactory::create,
            createBatteryMeterViewController = batteryMeterViewControllerFactory::create,
            statusBarIconController = statusBarIconController,
+3 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import com.android.compose.animation.scene.UserActionResult
import com.android.compose.animation.scene.animateSceneDpAsState
import com.android.compose.animation.scene.animateSceneFloatAsState
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.lifecycle.rememberViewModel
import com.android.systemui.notifications.ui.composable.SnoozeableHeadsUpNotificationSpace
import com.android.systemui.qs.ui.composable.QuickSettings
import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaLandscapeTopOffset
@@ -47,7 +48,7 @@ class GoneScene
@Inject
constructor(
    private val notificationStackScrolLView: Lazy<NotificationScrollView>,
    private val notificationsPlaceholderViewModel: NotificationsPlaceholderViewModel,
    private val notificationsPlaceholderViewModelFactory: NotificationsPlaceholderViewModel.Factory,
    private val viewModelFactory: GoneSceneActionsViewModel.Factory,
) : ComposableScene {
    override val key = Scenes.Gone
@@ -73,7 +74,7 @@ constructor(
        Spacer(modifier.fillMaxSize())
        SnoozeableHeadsUpNotificationSpace(
            stackScrollView = notificationStackScrolLView.get(),
            viewModel = notificationsPlaceholderViewModel
            viewModel = rememberViewModel { notificationsPlaceholderViewModelFactory.create() },
        )
    }
}
+3 −2
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ constructor(
    private val notificationStackScrollView: Lazy<NotificationScrollView>,
    private val actionsViewModelFactory: ShadeSceneActionsViewModel.Factory,
    private val contentViewModelFactory: ShadeSceneContentViewModel.Factory,
    private val notificationsPlaceholderViewModel: NotificationsPlaceholderViewModel,
    private val notificationsPlaceholderViewModelFactory: NotificationsPlaceholderViewModel.Factory,
    private val tintedIconManagerFactory: TintedIconManager.Factory,
    private val batteryMeterViewControllerFactory: BatteryMeterViewController.Factory,
    private val statusBarIconController: StatusBarIconController,
@@ -177,7 +177,8 @@ constructor(
        ShadeScene(
            notificationStackScrollView.get(),
            viewModel = rememberViewModel { contentViewModelFactory.create() },
            notificationsPlaceholderViewModel = notificationsPlaceholderViewModel,
            notificationsPlaceholderViewModel =
                rememberViewModel { notificationsPlaceholderViewModelFactory.create() },
            createTintedIconManager = tintedIconManagerFactory::create,
            createBatteryMeterViewController = batteryMeterViewControllerFactory::create,
            statusBarIconController = statusBarIconController,
Loading