Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt +9 −4 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ constructor( if (shouldUseSplitNotificationShade) { with(notificationSection) { Notifications( burnInParams = null, modifier = Modifier.fillMaxWidth(0.5f) .fillMaxHeight() .align(alignment = Alignment.TopEnd) Loading @@ -95,7 +97,10 @@ constructor( } if (!shouldUseSplitNotificationShade) { with(notificationSection) { Notifications(Modifier.weight(weight = 1f)) Notifications( burnInParams = null, modifier = Modifier.weight(weight = 1f) ) } } if (!isUdfpsVisible && ambientIndicationSectionOptional.isPresent) { Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/ShortcutsBesideUdfpsBlueprint.kt +9 −4 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ constructor( if (shouldUseSplitNotificationShade) { with(notificationSection) { Notifications( burnInParams = null, modifier = Modifier.fillMaxWidth(0.5f) .fillMaxHeight() .align(alignment = Alignment.TopEnd) Loading @@ -95,7 +97,10 @@ constructor( } if (!shouldUseSplitNotificationShade) { with(notificationSection) { Notifications(Modifier.weight(weight = 1f)) Notifications( burnInParams = null, modifier = Modifier.weight(weight = 1f) ) } } if (!isUdfpsVisible && ambientIndicationSectionOptional.isPresent) { Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/WeatherClockBlueprint.kt +2 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ constructor( if (areNotificationsVisible) { with(notificationSection) { Notifications( burnInParams = burnIn.parameters, modifier = Modifier.fillMaxWidth().weight(weight = 1f) ) } Loading Loading @@ -375,6 +376,7 @@ constructor( ) } Notifications( burnInParams = burnIn.parameters, modifier = Modifier.fillMaxHeight() .weight(weight = 1f) Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt +24 −4 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ import com.android.compose.modifiers.thenIf import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton 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.keyguard.ui.viewmodel.LockscreenContentViewModel import com.android.systemui.notifications.ui.composable.ConstrainedNotificationStack import com.android.systemui.res.R Loading @@ -48,6 +51,7 @@ class NotificationSection @Inject constructor( private val viewModel: NotificationsPlaceholderViewModel, private val aodBurnInViewModel: AodBurnInViewModel, sharedNotificationContainer: SharedNotificationContainer, sharedNotificationContainerViewModel: SharedNotificationContainerViewModel, stackScrollLayout: NotificationStackScrollLayout, Loading Loading @@ -77,8 +81,12 @@ constructor( ) } /** * @param burnInParams params to make this view adaptive to burn-in, `null` to disable burn-in * adjustment */ @Composable fun SceneScope.Notifications(modifier: Modifier = Modifier) { fun SceneScope.Notifications(burnInParams: BurnInParameters?, modifier: Modifier = Modifier) { val shouldUseSplitNotificationShade by lockscreenContentViewModel.shouldUseSplitNotificationShade.collectAsState() val areNotificationsVisible by Loading @@ -97,8 +105,20 @@ constructor( ConstrainedNotificationStack( viewModel = viewModel, modifier = modifier.fillMaxWidth().thenIf(shouldUseSplitNotificationShade) { modifier .fillMaxWidth() .thenIf(shouldUseSplitNotificationShade) { Modifier.padding(top = splitShadeTopMargin) } .let { if (burnInParams == null) { it } else { it.burnInAware( viewModel = aodBurnInViewModel, params = burnInParams, ) } }, ) } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/NotificationStackAppearanceIntegrationTest.kt +4 −5 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.shared.model.fakeSceneDataSource import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimShape import com.android.systemui.statusbar.notification.stack.shared.model.ViewPosition import com.android.systemui.statusbar.notification.stack.ui.viewmodel.notificationScrollViewModel import com.android.systemui.statusbar.notification.stack.ui.viewmodel.notificationsPlaceholderViewModel import com.android.systemui.testKosmos Loading Loading @@ -67,8 +66,8 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { fun updateBounds() = testScope.runTest { val radius = MutableStateFlow(32) val viewPosition = MutableStateFlow(ViewPosition(0, 0)) val shape by collectLastValue(appearanceViewModel.shadeScrimShape(radius, viewPosition)) val leftOffset = MutableStateFlow(0) val shape by collectLastValue(appearanceViewModel.shadeScrimShape(radius, leftOffset)) placeholderViewModel.onScrimBoundsChanged( ShadeScrimBounds(left = 0f, top = 200f, right = 100f, bottom = 550f) Loading @@ -83,7 +82,7 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { ) ) viewPosition.value = ViewPosition(200, 15) leftOffset.value = 200 radius.value = 24 placeholderViewModel.onScrimBoundsChanged( ShadeScrimBounds(left = 210f, top = 200f, right = 300f, bottom = 550f) Loading @@ -92,7 +91,7 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { .isEqualTo( ShadeScrimShape( bounds = ShadeScrimBounds(left = 10f, top = 185f, right = 100f, bottom = 535f), ShadeScrimBounds(left = 10f, top = 200f, right = 100f, bottom = 550f), topRadius = 24, bottomRadius = 0 ) Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/DefaultBlueprint.kt +9 −4 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ constructor( if (shouldUseSplitNotificationShade) { with(notificationSection) { Notifications( burnInParams = null, modifier = Modifier.fillMaxWidth(0.5f) .fillMaxHeight() .align(alignment = Alignment.TopEnd) Loading @@ -95,7 +97,10 @@ constructor( } if (!shouldUseSplitNotificationShade) { with(notificationSection) { Notifications(Modifier.weight(weight = 1f)) Notifications( burnInParams = null, modifier = Modifier.weight(weight = 1f) ) } } if (!isUdfpsVisible && ambientIndicationSectionOptional.isPresent) { Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/ShortcutsBesideUdfpsBlueprint.kt +9 −4 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ constructor( if (shouldUseSplitNotificationShade) { with(notificationSection) { Notifications( burnInParams = null, modifier = Modifier.fillMaxWidth(0.5f) .fillMaxHeight() .align(alignment = Alignment.TopEnd) Loading @@ -95,7 +97,10 @@ constructor( } if (!shouldUseSplitNotificationShade) { with(notificationSection) { Notifications(Modifier.weight(weight = 1f)) Notifications( burnInParams = null, modifier = Modifier.weight(weight = 1f) ) } } if (!isUdfpsVisible && ambientIndicationSectionOptional.isPresent) { Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/blueprint/WeatherClockBlueprint.kt +2 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ constructor( if (areNotificationsVisible) { with(notificationSection) { Notifications( burnInParams = burnIn.parameters, modifier = Modifier.fillMaxWidth().weight(weight = 1f) ) } Loading Loading @@ -375,6 +376,7 @@ constructor( ) } Notifications( burnInParams = burnIn.parameters, modifier = Modifier.fillMaxHeight() .weight(weight = 1f) Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/NotificationSection.kt +24 −4 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ import com.android.compose.modifiers.thenIf import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton 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.keyguard.ui.viewmodel.LockscreenContentViewModel import com.android.systemui.notifications.ui.composable.ConstrainedNotificationStack import com.android.systemui.res.R Loading @@ -48,6 +51,7 @@ class NotificationSection @Inject constructor( private val viewModel: NotificationsPlaceholderViewModel, private val aodBurnInViewModel: AodBurnInViewModel, sharedNotificationContainer: SharedNotificationContainer, sharedNotificationContainerViewModel: SharedNotificationContainerViewModel, stackScrollLayout: NotificationStackScrollLayout, Loading Loading @@ -77,8 +81,12 @@ constructor( ) } /** * @param burnInParams params to make this view adaptive to burn-in, `null` to disable burn-in * adjustment */ @Composable fun SceneScope.Notifications(modifier: Modifier = Modifier) { fun SceneScope.Notifications(burnInParams: BurnInParameters?, modifier: Modifier = Modifier) { val shouldUseSplitNotificationShade by lockscreenContentViewModel.shouldUseSplitNotificationShade.collectAsState() val areNotificationsVisible by Loading @@ -97,8 +105,20 @@ constructor( ConstrainedNotificationStack( viewModel = viewModel, modifier = modifier.fillMaxWidth().thenIf(shouldUseSplitNotificationShade) { modifier .fillMaxWidth() .thenIf(shouldUseSplitNotificationShade) { Modifier.padding(top = splitShadeTopMargin) } .let { if (burnInParams == null) { it } else { it.burnInAware( viewModel = aodBurnInViewModel, params = burnInParams, ) } }, ) } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/NotificationStackAppearanceIntegrationTest.kt +4 −5 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.shared.model.fakeSceneDataSource import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimShape import com.android.systemui.statusbar.notification.stack.shared.model.ViewPosition import com.android.systemui.statusbar.notification.stack.ui.viewmodel.notificationScrollViewModel import com.android.systemui.statusbar.notification.stack.ui.viewmodel.notificationsPlaceholderViewModel import com.android.systemui.testKosmos Loading Loading @@ -67,8 +66,8 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { fun updateBounds() = testScope.runTest { val radius = MutableStateFlow(32) val viewPosition = MutableStateFlow(ViewPosition(0, 0)) val shape by collectLastValue(appearanceViewModel.shadeScrimShape(radius, viewPosition)) val leftOffset = MutableStateFlow(0) val shape by collectLastValue(appearanceViewModel.shadeScrimShape(radius, leftOffset)) placeholderViewModel.onScrimBoundsChanged( ShadeScrimBounds(left = 0f, top = 200f, right = 100f, bottom = 550f) Loading @@ -83,7 +82,7 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { ) ) viewPosition.value = ViewPosition(200, 15) leftOffset.value = 200 radius.value = 24 placeholderViewModel.onScrimBoundsChanged( ShadeScrimBounds(left = 210f, top = 200f, right = 300f, bottom = 550f) Loading @@ -92,7 +91,7 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { .isEqualTo( ShadeScrimShape( bounds = ShadeScrimBounds(left = 10f, top = 185f, right = 100f, bottom = 535f), ShadeScrimBounds(left = 10f, top = 200f, right = 100f, bottom = 550f), topRadius = 24, bottomRadius = 0 ) Loading