Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt +0 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import com.android.systemui.compose.modifiers.sysuiResTag import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel import javax.inject.Inject /** * Renders the content of the lockscreen. Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +3 −2 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ fun SceneScope.NotificationScrollingStack( viewModel: NotificationsPlaceholderViewModel, maxScrimTop: () -> Float, shouldPunchHoleBehindScrim: Boolean, shouldFillMaxSize: Boolean = true, shadeMode: ShadeMode, modifier: Modifier = Modifier, ) { Loading Loading @@ -327,14 +328,14 @@ fun SceneScope.NotificationScrollingStack( } Box( modifier = Modifier.fillMaxSize() .graphicsLayer { Modifier.graphicsLayer { alpha = if (shouldPunchHoleBehindScrim) { (expansionFraction / EXPANSION_FOR_MAX_SCRIM_ALPHA).coerceAtMost(1f) } else 1f } .background(MaterialTheme.colorScheme.surface) .thenIf(shouldFillMaxSize) { Modifier.fillMaxSize() } .debugBackground(viewModel, DEBUG_BOX_COLOR) ) { NotificationPlaceholder( Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/NotificationsShadeScene.kt +41 −14 Original line number Diff line number Diff line Loading @@ -17,21 +17,31 @@ package com.android.systemui.notifications.ui.composable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.material3.Text import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.android.compose.animation.scene.SceneScope import com.android.compose.animation.scene.UserAction 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.notifications.ui.viewmodel.NotificationsShadeSceneViewModel import com.android.systemui.scene.session.ui.composable.SaveableSession import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.ui.composable.ComposableScene import com.android.systemui.shade.shared.model.ShadeMode import com.android.systemui.shade.ui.composable.ExpandedShadeHeader import com.android.systemui.shade.ui.composable.OverlayShade import com.android.systemui.shade.ui.viewmodel.OverlayShadeViewModel import com.android.systemui.shade.ui.viewmodel.ShadeHeaderViewModel import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationsPlaceholderViewModel import com.android.systemui.statusbar.phone.ui.StatusBarIconController import com.android.systemui.statusbar.phone.ui.TintedIconManager import dagger.Lazy import java.util.Optional import javax.inject.Inject Loading @@ -41,36 +51,53 @@ import kotlinx.coroutines.flow.StateFlow class NotificationsShadeScene @Inject constructor( viewModel: NotificationsShadeSceneViewModel, sceneViewModel: NotificationsShadeSceneViewModel, private val overlayShadeViewModel: OverlayShadeViewModel, private val shadeHeaderViewModel: ShadeHeaderViewModel, private val notificationsPlaceholderViewModel: NotificationsPlaceholderViewModel, private val tintedIconManagerFactory: TintedIconManager.Factory, private val batteryMeterViewControllerFactory: BatteryMeterViewController.Factory, private val statusBarIconController: StatusBarIconController, private val shadeSession: SaveableSession, private val stackScrollView: Lazy<NotificationScrollView>, private val lockscreenContent: Lazy<Optional<LockscreenContent>>, ) : ComposableScene { override val key = Scenes.NotificationsShade override val destinationScenes: StateFlow<Map<UserAction, UserActionResult>> = viewModel.destinationScenes sceneViewModel.destinationScenes @Composable override fun SceneScope.Content( modifier: Modifier, ) { OverlayShade( viewModel = overlayShadeViewModel, modifier = modifier, viewModel = overlayShadeViewModel, horizontalArrangement = Arrangement.Start, lockscreenContent = lockscreenContent, ) { Text( text = "Notifications list", modifier = Modifier.padding(NotificationsShade.Dimensions.Padding) Column { ExpandedShadeHeader( viewModel = shadeHeaderViewModel, createTintedIconManager = tintedIconManagerFactory::create, createBatteryMeterViewController = batteryMeterViewControllerFactory::create, statusBarIconController = statusBarIconController, modifier = Modifier.padding(horizontal = 16.dp), ) NotificationScrollingStack( shadeSession = shadeSession, stackScrollView = stackScrollView.get(), viewModel = notificationsPlaceholderViewModel, maxScrimTop = { 0f }, shouldPunchHoleBehindScrim = false, shouldFillMaxSize = false, shadeMode = ShadeMode.Dual, modifier = Modifier.width(416.dp), ) } } } object NotificationsShade { object Dimensions { val Padding = 16.dp } } packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeScene.kt +1 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ import com.android.systemui.scene.ui.composable.ComposableScene import com.android.systemui.shade.ui.composable.OverlayShade import com.android.systemui.shade.ui.viewmodel.OverlayShadeViewModel import dagger.Lazy import java.util.Optional import javax.inject.Inject import kotlinx.coroutines.flow.StateFlow import java.util.Optional @SysUISingleton class QuickSettingsShadeScene Loading packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorSceneContainerImpl.kt +24 −8 Original line number Diff line number Diff line Loading @@ -49,11 +49,13 @@ constructor( sharedNotificationContainerInteractor: SharedNotificationContainerInteractor, shadeRepository: ShadeRepository, ) : BaseShadeInteractor { override val shadeMode: StateFlow<ShadeMode> = shadeRepository.shadeMode override val shadeExpansion: StateFlow<Float> = sceneBasedExpansion(sceneInteractor, Scenes.Shade) sceneBasedExpansion(sceneInteractor, notificationsScene) .stateIn(scope, SharingStarted.Eagerly, 0f) private val sceneBasedQsExpansion = sceneBasedExpansion(sceneInteractor, Scenes.QuickSettings) private val sceneBasedQsExpansion = sceneBasedExpansion(sceneInteractor, quickSettingsScene) override val qsExpansion: StateFlow<Float> = combine( Loading Loading @@ -81,7 +83,7 @@ constructor( when (state) { is ObservableTransitionState.Idle -> false is ObservableTransitionState.Transition -> state.toScene == Scenes.QuickSettings && state.fromScene != Scenes.Shade state.toScene == quickSettingsScene && state.fromScene != notificationsScene } } .distinctUntilChanged() Loading @@ -90,7 +92,7 @@ constructor( sceneInteractor.transitionState .map { state -> when (state) { is ObservableTransitionState.Idle -> state.currentScene == Scenes.QuickSettings is ObservableTransitionState.Idle -> state.currentScene == quickSettingsScene is ObservableTransitionState.Transition -> false } } Loading @@ -106,12 +108,10 @@ constructor( .stateIn(scope, SharingStarted.Eagerly, false) override val isUserInteractingWithShade: Flow<Boolean> = sceneBasedInteracting(sceneInteractor, Scenes.Shade) sceneBasedInteracting(sceneInteractor, notificationsScene) override val isUserInteractingWithQs: Flow<Boolean> = sceneBasedInteracting(sceneInteractor, Scenes.QuickSettings) override val shadeMode: StateFlow<ShadeMode> = shadeRepository.shadeMode sceneBasedInteracting(sceneInteractor, quickSettingsScene) /** * Returns a flow that uses scene transition progress to and from a scene that is pulled down Loading Loading @@ -154,4 +154,20 @@ constructor( } } .distinctUntilChanged() private val notificationsScene: SceneKey get() = if (shadeMode.value is ShadeMode.Dual) { Scenes.NotificationsShade } else { Scenes.Shade } private val quickSettingsScene: SceneKey get() = if (shadeMode.value is ShadeMode.Dual) { Scenes.QuickSettingsShade } else { Scenes.QuickSettings } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt +0 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import com.android.systemui.compose.modifiers.sysuiResTag import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel import javax.inject.Inject /** * Renders the content of the lockscreen. Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +3 −2 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ fun SceneScope.NotificationScrollingStack( viewModel: NotificationsPlaceholderViewModel, maxScrimTop: () -> Float, shouldPunchHoleBehindScrim: Boolean, shouldFillMaxSize: Boolean = true, shadeMode: ShadeMode, modifier: Modifier = Modifier, ) { Loading Loading @@ -327,14 +328,14 @@ fun SceneScope.NotificationScrollingStack( } Box( modifier = Modifier.fillMaxSize() .graphicsLayer { Modifier.graphicsLayer { alpha = if (shouldPunchHoleBehindScrim) { (expansionFraction / EXPANSION_FOR_MAX_SCRIM_ALPHA).coerceAtMost(1f) } else 1f } .background(MaterialTheme.colorScheme.surface) .thenIf(shouldFillMaxSize) { Modifier.fillMaxSize() } .debugBackground(viewModel, DEBUG_BOX_COLOR) ) { NotificationPlaceholder( Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/NotificationsShadeScene.kt +41 −14 Original line number Diff line number Diff line Loading @@ -17,21 +17,31 @@ package com.android.systemui.notifications.ui.composable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.material3.Text import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.android.compose.animation.scene.SceneScope import com.android.compose.animation.scene.UserAction 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.notifications.ui.viewmodel.NotificationsShadeSceneViewModel import com.android.systemui.scene.session.ui.composable.SaveableSession import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.ui.composable.ComposableScene import com.android.systemui.shade.shared.model.ShadeMode import com.android.systemui.shade.ui.composable.ExpandedShadeHeader import com.android.systemui.shade.ui.composable.OverlayShade import com.android.systemui.shade.ui.viewmodel.OverlayShadeViewModel import com.android.systemui.shade.ui.viewmodel.ShadeHeaderViewModel import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationsPlaceholderViewModel import com.android.systemui.statusbar.phone.ui.StatusBarIconController import com.android.systemui.statusbar.phone.ui.TintedIconManager import dagger.Lazy import java.util.Optional import javax.inject.Inject Loading @@ -41,36 +51,53 @@ import kotlinx.coroutines.flow.StateFlow class NotificationsShadeScene @Inject constructor( viewModel: NotificationsShadeSceneViewModel, sceneViewModel: NotificationsShadeSceneViewModel, private val overlayShadeViewModel: OverlayShadeViewModel, private val shadeHeaderViewModel: ShadeHeaderViewModel, private val notificationsPlaceholderViewModel: NotificationsPlaceholderViewModel, private val tintedIconManagerFactory: TintedIconManager.Factory, private val batteryMeterViewControllerFactory: BatteryMeterViewController.Factory, private val statusBarIconController: StatusBarIconController, private val shadeSession: SaveableSession, private val stackScrollView: Lazy<NotificationScrollView>, private val lockscreenContent: Lazy<Optional<LockscreenContent>>, ) : ComposableScene { override val key = Scenes.NotificationsShade override val destinationScenes: StateFlow<Map<UserAction, UserActionResult>> = viewModel.destinationScenes sceneViewModel.destinationScenes @Composable override fun SceneScope.Content( modifier: Modifier, ) { OverlayShade( viewModel = overlayShadeViewModel, modifier = modifier, viewModel = overlayShadeViewModel, horizontalArrangement = Arrangement.Start, lockscreenContent = lockscreenContent, ) { Text( text = "Notifications list", modifier = Modifier.padding(NotificationsShade.Dimensions.Padding) Column { ExpandedShadeHeader( viewModel = shadeHeaderViewModel, createTintedIconManager = tintedIconManagerFactory::create, createBatteryMeterViewController = batteryMeterViewControllerFactory::create, statusBarIconController = statusBarIconController, modifier = Modifier.padding(horizontal = 16.dp), ) NotificationScrollingStack( shadeSession = shadeSession, stackScrollView = stackScrollView.get(), viewModel = notificationsPlaceholderViewModel, maxScrimTop = { 0f }, shouldPunchHoleBehindScrim = false, shouldFillMaxSize = false, shadeMode = ShadeMode.Dual, modifier = Modifier.width(416.dp), ) } } } object NotificationsShade { object Dimensions { val Padding = 16.dp } }
packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeScene.kt +1 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ import com.android.systemui.scene.ui.composable.ComposableScene import com.android.systemui.shade.ui.composable.OverlayShade import com.android.systemui.shade.ui.viewmodel.OverlayShadeViewModel import dagger.Lazy import java.util.Optional import javax.inject.Inject import kotlinx.coroutines.flow.StateFlow import java.util.Optional @SysUISingleton class QuickSettingsShadeScene Loading
packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorSceneContainerImpl.kt +24 −8 Original line number Diff line number Diff line Loading @@ -49,11 +49,13 @@ constructor( sharedNotificationContainerInteractor: SharedNotificationContainerInteractor, shadeRepository: ShadeRepository, ) : BaseShadeInteractor { override val shadeMode: StateFlow<ShadeMode> = shadeRepository.shadeMode override val shadeExpansion: StateFlow<Float> = sceneBasedExpansion(sceneInteractor, Scenes.Shade) sceneBasedExpansion(sceneInteractor, notificationsScene) .stateIn(scope, SharingStarted.Eagerly, 0f) private val sceneBasedQsExpansion = sceneBasedExpansion(sceneInteractor, Scenes.QuickSettings) private val sceneBasedQsExpansion = sceneBasedExpansion(sceneInteractor, quickSettingsScene) override val qsExpansion: StateFlow<Float> = combine( Loading Loading @@ -81,7 +83,7 @@ constructor( when (state) { is ObservableTransitionState.Idle -> false is ObservableTransitionState.Transition -> state.toScene == Scenes.QuickSettings && state.fromScene != Scenes.Shade state.toScene == quickSettingsScene && state.fromScene != notificationsScene } } .distinctUntilChanged() Loading @@ -90,7 +92,7 @@ constructor( sceneInteractor.transitionState .map { state -> when (state) { is ObservableTransitionState.Idle -> state.currentScene == Scenes.QuickSettings is ObservableTransitionState.Idle -> state.currentScene == quickSettingsScene is ObservableTransitionState.Transition -> false } } Loading @@ -106,12 +108,10 @@ constructor( .stateIn(scope, SharingStarted.Eagerly, false) override val isUserInteractingWithShade: Flow<Boolean> = sceneBasedInteracting(sceneInteractor, Scenes.Shade) sceneBasedInteracting(sceneInteractor, notificationsScene) override val isUserInteractingWithQs: Flow<Boolean> = sceneBasedInteracting(sceneInteractor, Scenes.QuickSettings) override val shadeMode: StateFlow<ShadeMode> = shadeRepository.shadeMode sceneBasedInteracting(sceneInteractor, quickSettingsScene) /** * Returns a flow that uses scene transition progress to and from a scene that is pulled down Loading Loading @@ -154,4 +154,20 @@ constructor( } } .distinctUntilChanged() private val notificationsScene: SceneKey get() = if (shadeMode.value is ShadeMode.Dual) { Scenes.NotificationsShade } else { Scenes.Shade } private val quickSettingsScene: SceneKey get() = if (shadeMode.value is ShadeMode.Dual) { Scenes.QuickSettingsShade } else { Scenes.QuickSettings } }