Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +10 −1 Original line number Diff line number Diff line Loading @@ -27,11 +27,13 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.LayoutCoordinates import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onPlaced Loading Loading @@ -89,13 +91,18 @@ fun SceneScope.NotificationStack( isScrimVisible: Boolean, modifier: Modifier = Modifier, ) { val cornerRadius by viewModel.cornerRadiusDp.collectAsState() Box(modifier = modifier) { if (isScrimVisible) { Box( modifier = Modifier.element(Notifications.Elements.NotificationScrim) .fillMaxSize() .clip(RoundedCornerShape(32.dp)) .graphicsLayer { shape = RoundedCornerShape(cornerRadius.dp) clip = true } .background(MaterialTheme.colorScheme.surface) ) } Loading Loading @@ -167,7 +174,9 @@ private fun SceneScope.NotificationPlaceholder( } val boundsInWindow = coordinates.boundsInWindow() viewModel.onBoundsChanged( left = boundsInWindow.left, top = boundsInWindow.top, right = boundsInWindow.right, bottom = boundsInWindow.bottom, ) } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/NotificationStackAppearanceIntegrationTest.kt +17 −2 Original line number Diff line number Diff line Loading @@ -67,9 +67,24 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { val bounds by collectLastValue(appearanceViewModel.stackBounds) val top = 200f val left = 0f val bottom = 550f placeholderViewModel.onBoundsChanged(top, bottom) assertThat(bounds).isEqualTo(NotificationContainerBounds(top = top, bottom = bottom)) val right = 100f placeholderViewModel.onBoundsChanged( left = left, top = top, right = right, bottom = bottom ) assertThat(bounds) .isEqualTo( NotificationContainerBounds( left = left, top = top, right = right, bottom = bottom ) ) } @Test Loading packages/SystemUI/src/com/android/systemui/common/shared/model/NotificationContainerBounds.kt +4 −0 Original line number Diff line number Diff line Loading @@ -18,8 +18,12 @@ package com.android.systemui.common.shared.model /** Models the bounds of the notification container. */ data class NotificationContainerBounds( /** The position of the left of the container in its window coordinate system, in pixels. */ val left: Float = 0f, /** The position of the top of the container in its window coordinate system, in pixels. */ val top: Float = 0f, /** The position of the right of the container in its window coordinate system, in pixels. */ val right: Float = 0f, /** The position of the bottom of the container in its window coordinate system, in pixels. */ val bottom: Float = 0f, /** Whether any modifications to top/bottom should be smoothly animated. */ Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/NotificationStackScrollLayoutSection.kt +1 −1 Original line number Diff line number Diff line Loading @@ -85,9 +85,9 @@ constructor( ) if (sceneContainerFlags.flexiNotifsEnabled()) { NotificationStackAppearanceViewBinder.bind( context, sharedNotificationContainer, notificationStackAppearanceViewModel, sceneContainerFlags, ambientState, controller, ) Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +3 −1 Original line number Diff line number Diff line Loading @@ -229,7 +229,9 @@ constructor( .distinctUntilChanged() fun onNotificationContainerBoundsChanged(top: Float, bottom: Float) { keyguardInteractor.setNotificationContainerBounds(NotificationContainerBounds(top, bottom)) keyguardInteractor.setNotificationContainerBounds( NotificationContainerBounds(top = top, bottom = bottom) ) } /** Is there an expanded pulse, are we animating in response? */ Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +10 −1 Original line number Diff line number Diff line Loading @@ -27,11 +27,13 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.layout.LayoutCoordinates import androidx.compose.ui.layout.boundsInWindow import androidx.compose.ui.layout.onPlaced Loading Loading @@ -89,13 +91,18 @@ fun SceneScope.NotificationStack( isScrimVisible: Boolean, modifier: Modifier = Modifier, ) { val cornerRadius by viewModel.cornerRadiusDp.collectAsState() Box(modifier = modifier) { if (isScrimVisible) { Box( modifier = Modifier.element(Notifications.Elements.NotificationScrim) .fillMaxSize() .clip(RoundedCornerShape(32.dp)) .graphicsLayer { shape = RoundedCornerShape(cornerRadius.dp) clip = true } .background(MaterialTheme.colorScheme.surface) ) } Loading Loading @@ -167,7 +174,9 @@ private fun SceneScope.NotificationPlaceholder( } val boundsInWindow = coordinates.boundsInWindow() viewModel.onBoundsChanged( left = boundsInWindow.left, top = boundsInWindow.top, right = boundsInWindow.right, bottom = boundsInWindow.bottom, ) } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/NotificationStackAppearanceIntegrationTest.kt +17 −2 Original line number Diff line number Diff line Loading @@ -67,9 +67,24 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() { val bounds by collectLastValue(appearanceViewModel.stackBounds) val top = 200f val left = 0f val bottom = 550f placeholderViewModel.onBoundsChanged(top, bottom) assertThat(bounds).isEqualTo(NotificationContainerBounds(top = top, bottom = bottom)) val right = 100f placeholderViewModel.onBoundsChanged( left = left, top = top, right = right, bottom = bottom ) assertThat(bounds) .isEqualTo( NotificationContainerBounds( left = left, top = top, right = right, bottom = bottom ) ) } @Test Loading
packages/SystemUI/src/com/android/systemui/common/shared/model/NotificationContainerBounds.kt +4 −0 Original line number Diff line number Diff line Loading @@ -18,8 +18,12 @@ package com.android.systemui.common.shared.model /** Models the bounds of the notification container. */ data class NotificationContainerBounds( /** The position of the left of the container in its window coordinate system, in pixels. */ val left: Float = 0f, /** The position of the top of the container in its window coordinate system, in pixels. */ val top: Float = 0f, /** The position of the right of the container in its window coordinate system, in pixels. */ val right: Float = 0f, /** The position of the bottom of the container in its window coordinate system, in pixels. */ val bottom: Float = 0f, /** Whether any modifications to top/bottom should be smoothly animated. */ Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/NotificationStackScrollLayoutSection.kt +1 −1 Original line number Diff line number Diff line Loading @@ -85,9 +85,9 @@ constructor( ) if (sceneContainerFlags.flexiNotifsEnabled()) { NotificationStackAppearanceViewBinder.bind( context, sharedNotificationContainer, notificationStackAppearanceViewModel, sceneContainerFlags, ambientState, controller, ) Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +3 −1 Original line number Diff line number Diff line Loading @@ -229,7 +229,9 @@ constructor( .distinctUntilChanged() fun onNotificationContainerBoundsChanged(top: Float, bottom: Float) { keyguardInteractor.setNotificationContainerBounds(NotificationContainerBounds(top, bottom)) keyguardInteractor.setNotificationContainerBounds( NotificationContainerBounds(top = top, bottom = bottom) ) } /** Is there an expanded pulse, are we animating in response? */ Loading