Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt +4 −0 Original line number Diff line number Diff line Loading @@ -40,16 +40,19 @@ import com.android.systemui.notifications.ui.composable.ConstrainedNotificationS import com.android.systemui.res.R import com.android.systemui.shade.LargeScreenHeaderHelper import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer import com.android.systemui.statusbar.notification.stack.ui.viewbinder.SharedNotificationContainerBinder import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationsPlaceholderViewModel import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel import dagger.Lazy import javax.inject.Inject @SysUISingleton class NotificationSection @Inject constructor( private val stackScrollView: Lazy<NotificationScrollView>, private val viewModel: NotificationsPlaceholderViewModel, private val aodBurnInViewModel: AodBurnInViewModel, sharedNotificationContainer: SharedNotificationContainer, Loading Loading @@ -103,6 +106,7 @@ constructor( } ConstrainedNotificationStack( stackScrollView = stackScrollView.get(), viewModel = viewModel, modifier = modifier Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +6 −4 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ fun SceneScope.HeadsUpNotificationSpace( /** Adds the space where notification stack should appear in the scene. */ @Composable fun SceneScope.ConstrainedNotificationStack( stackScrollView: NotificationScrollView, viewModel: NotificationsPlaceholderViewModel, modifier: Modifier = Modifier, ) { Loading @@ -146,6 +147,7 @@ fun SceneScope.ConstrainedNotificationStack( modifier.onSizeChanged { viewModel.onConstrainedAvailableSpaceChanged(it.height) } ) { NotificationPlaceholder( stackScrollView = stackScrollView, viewModel = viewModel, modifier = Modifier.fillMaxSize(), ) Loading Loading @@ -334,6 +336,7 @@ fun SceneScope.NotificationScrollingStack( .debugBackground(viewModel, DEBUG_BOX_COLOR) ) { NotificationPlaceholder( stackScrollView = stackScrollView, viewModel = viewModel, modifier = Modifier.verticalNestedScrollToScene( Loading Loading @@ -390,6 +393,7 @@ fun SceneScope.NotificationShelfSpace( @Composable private fun SceneScope.NotificationPlaceholder( stackScrollView: NotificationScrollView, viewModel: NotificationsPlaceholderViewModel, modifier: Modifier = Modifier, ) { Loading @@ -408,10 +412,8 @@ private fun SceneScope.NotificationPlaceholder( " bounds=${coordinates.boundsInWindow()}" } // NOTE: positionInWindow.y scrolls off screen, but boundsInWindow.top will not viewModel.onStackBoundsChanged( top = positionInWindow.y, bottom = positionInWindow.y + coordinates.size.height, ) stackScrollView.setStackTop(positionInWindow.y) stackScrollView.setStackBottom(positionInWindow.y + coordinates.size.height) } ) { content {} Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModelTest.kt +0 −9 Original line number Diff line number Diff line Loading @@ -44,13 +44,4 @@ class NotificationsPlaceholderViewModelTest : SysuiTestCase() { collectLastValue(kosmos.notificationStackAppearanceInteractor.shadeScrimBounds) assertThat(stackBounds).isEqualTo(bounds) } @Test fun onStackBoundsChanged() = kosmos.testScope.runTest { underTest.onStackBoundsChanged(top = 5f, bottom = 500f) assertThat(kosmos.notificationStackAppearanceInteractor.stackTop.value).isEqualTo(5f) assertThat(kosmos.notificationStackAppearanceInteractor.stackBottom.value) .isEqualTo(500f) } } packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt +0 −9 Original line number Diff line number Diff line Loading @@ -660,9 +660,6 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S overrideResource(R.bool.config_use_split_notification_shade, false) configurationRepository.onAnyConfigurationChange() keyguardInteractor.setNotificationContainerBounds( NotificationContainerBounds(top = 1f, bottom = 2f) ) assertThat(maxNotifications).isEqualTo(10) Loading Loading @@ -691,9 +688,6 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S overrideResource(R.bool.config_use_split_notification_shade, false) configurationRepository.onAnyConfigurationChange() keyguardInteractor.setNotificationContainerBounds( NotificationContainerBounds(top = 1f, bottom = 2f) ) assertThat(maxNotifications).isEqualTo(10) Loading Loading @@ -728,9 +722,6 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S overrideResource(R.bool.config_use_split_notification_shade, false) configurationRepository.onAnyConfigurationChange() keyguardInteractor.setNotificationContainerBounds( NotificationContainerBounds(top = 1f, bottom = 2f) ) // -1 means No Limit assertThat(maxNotifications).isEqualTo(-1) Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +2 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ constructor( /** Bounds of the notification container. */ val notificationContainerBounds: StateFlow<NotificationContainerBounds> by lazy { SceneContainerFlag.assertInLegacyMode() combine( _notificationPlaceholderBounds, sharedNotificationContainerInteractor.get().configurationBasedDimensions, Loading @@ -115,6 +116,7 @@ constructor( } fun setNotificationContainerBounds(position: NotificationContainerBounds) { SceneContainerFlag.assertInLegacyMode() _notificationPlaceholderBounds.value = position } Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt +4 −0 Original line number Diff line number Diff line Loading @@ -40,16 +40,19 @@ import com.android.systemui.notifications.ui.composable.ConstrainedNotificationS import com.android.systemui.res.R import com.android.systemui.shade.LargeScreenHeaderHelper import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer import com.android.systemui.statusbar.notification.stack.ui.viewbinder.SharedNotificationContainerBinder import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationsPlaceholderViewModel import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel import dagger.Lazy import javax.inject.Inject @SysUISingleton class NotificationSection @Inject constructor( private val stackScrollView: Lazy<NotificationScrollView>, private val viewModel: NotificationsPlaceholderViewModel, private val aodBurnInViewModel: AodBurnInViewModel, sharedNotificationContainer: SharedNotificationContainer, Loading Loading @@ -103,6 +106,7 @@ constructor( } ConstrainedNotificationStack( stackScrollView = stackScrollView.get(), viewModel = viewModel, modifier = modifier Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +6 −4 Original line number Diff line number Diff line Loading @@ -138,6 +138,7 @@ fun SceneScope.HeadsUpNotificationSpace( /** Adds the space where notification stack should appear in the scene. */ @Composable fun SceneScope.ConstrainedNotificationStack( stackScrollView: NotificationScrollView, viewModel: NotificationsPlaceholderViewModel, modifier: Modifier = Modifier, ) { Loading @@ -146,6 +147,7 @@ fun SceneScope.ConstrainedNotificationStack( modifier.onSizeChanged { viewModel.onConstrainedAvailableSpaceChanged(it.height) } ) { NotificationPlaceholder( stackScrollView = stackScrollView, viewModel = viewModel, modifier = Modifier.fillMaxSize(), ) Loading Loading @@ -334,6 +336,7 @@ fun SceneScope.NotificationScrollingStack( .debugBackground(viewModel, DEBUG_BOX_COLOR) ) { NotificationPlaceholder( stackScrollView = stackScrollView, viewModel = viewModel, modifier = Modifier.verticalNestedScrollToScene( Loading Loading @@ -390,6 +393,7 @@ fun SceneScope.NotificationShelfSpace( @Composable private fun SceneScope.NotificationPlaceholder( stackScrollView: NotificationScrollView, viewModel: NotificationsPlaceholderViewModel, modifier: Modifier = Modifier, ) { Loading @@ -408,10 +412,8 @@ private fun SceneScope.NotificationPlaceholder( " bounds=${coordinates.boundsInWindow()}" } // NOTE: positionInWindow.y scrolls off screen, but boundsInWindow.top will not viewModel.onStackBoundsChanged( top = positionInWindow.y, bottom = positionInWindow.y + coordinates.size.height, ) stackScrollView.setStackTop(positionInWindow.y) stackScrollView.setStackBottom(positionInWindow.y + coordinates.size.height) } ) { content {} Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModelTest.kt +0 −9 Original line number Diff line number Diff line Loading @@ -44,13 +44,4 @@ class NotificationsPlaceholderViewModelTest : SysuiTestCase() { collectLastValue(kosmos.notificationStackAppearanceInteractor.shadeScrimBounds) assertThat(stackBounds).isEqualTo(bounds) } @Test fun onStackBoundsChanged() = kosmos.testScope.runTest { underTest.onStackBoundsChanged(top = 5f, bottom = 500f) assertThat(kosmos.notificationStackAppearanceInteractor.stackTop.value).isEqualTo(5f) assertThat(kosmos.notificationStackAppearanceInteractor.stackBottom.value) .isEqualTo(500f) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt +0 −9 Original line number Diff line number Diff line Loading @@ -660,9 +660,6 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S overrideResource(R.bool.config_use_split_notification_shade, false) configurationRepository.onAnyConfigurationChange() keyguardInteractor.setNotificationContainerBounds( NotificationContainerBounds(top = 1f, bottom = 2f) ) assertThat(maxNotifications).isEqualTo(10) Loading Loading @@ -691,9 +688,6 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S overrideResource(R.bool.config_use_split_notification_shade, false) configurationRepository.onAnyConfigurationChange() keyguardInteractor.setNotificationContainerBounds( NotificationContainerBounds(top = 1f, bottom = 2f) ) assertThat(maxNotifications).isEqualTo(10) Loading Loading @@ -728,9 +722,6 @@ class SharedNotificationContainerViewModelTest(flags: FlagsParameterization) : S overrideResource(R.bool.config_use_split_notification_shade, false) configurationRepository.onAnyConfigurationChange() keyguardInteractor.setNotificationContainerBounds( NotificationContainerBounds(top = 1f, bottom = 2f) ) // -1 means No Limit assertThat(maxNotifications).isEqualTo(-1) Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt +2 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,7 @@ constructor( /** Bounds of the notification container. */ val notificationContainerBounds: StateFlow<NotificationContainerBounds> by lazy { SceneContainerFlag.assertInLegacyMode() combine( _notificationPlaceholderBounds, sharedNotificationContainerInteractor.get().configurationBasedDimensions, Loading @@ -115,6 +116,7 @@ constructor( } fun setNotificationContainerBounds(position: NotificationContainerBounds) { SceneContainerFlag.assertInLegacyMode() _notificationPlaceholderBounds.value = position } Loading