Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +15 −2 Original line number Diff line number Diff line Loading @@ -290,6 +290,7 @@ fun SceneScope.NotificationScrollingStack( val isCurrentGestureOverscroll = viewModel.isCurrentGestureOverscroll.collectAsStateWithLifecycle(false) val expansionFraction by viewModel.expandFraction.collectAsStateWithLifecycle(0f) val shadeToQsFraction by viewModel.shadeToQsFraction.collectAsStateWithLifecycle(0f) val topPadding = dimensionResource(id = R.dimen.notification_side_paddings) val navBarHeight = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding() Loading Loading @@ -385,14 +386,26 @@ fun SceneScope.NotificationScrollingStack( modifier .element(Notifications.Elements.NotificationScrim) .offset { // if scrim is expanded while transitioning to Gone scene, increase the offset // in step with the transition so that it is 0 when it completes. // if scrim is expanded while transitioning to Gone or QS scene, increase the // offset in step with the corresponding transition so that it is 0 when it // completes. if ( scrimOffset.value < 0 && layoutState.isTransitioning(from = Scenes.Shade, to = Scenes.Gone) || layoutState.isTransitioning(from = Scenes.Shade, to = Scenes.Lockscreen) ) { IntOffset(x = 0, y = (scrimOffset.value * expansionFraction).roundToInt()) } else if ( scrimOffset.value < 0 && layoutState.isTransitioning( from = Scenes.Shade, to = Scenes.QuickSettings ) ) { IntOffset( x = 0, y = (scrimOffset.value * (1 - shadeToQsFraction)).roundToInt() ) } else { IntOffset(x = 0, y = scrimOffset.value.roundToInt()) } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt +6 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,12 @@ constructor( */ val expandFraction: Flow<Float> = shadeInteractor.anyExpansion.dumpValue("expandFraction") /** * The amount [0-1] that quick settings has been opened. At 0, the shade may be open or closed; * at 1, the quick settings are open. */ val shadeToQsFraction: Flow<Float> = shadeInteractor.qsExpansion.dumpValue("shadeToQsFraction") /** * The amount in px that the notification stack should scroll due to internal expansion. This * should only happen when a notification expansion hits the bottom of the screen, so it is Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +15 −2 Original line number Diff line number Diff line Loading @@ -290,6 +290,7 @@ fun SceneScope.NotificationScrollingStack( val isCurrentGestureOverscroll = viewModel.isCurrentGestureOverscroll.collectAsStateWithLifecycle(false) val expansionFraction by viewModel.expandFraction.collectAsStateWithLifecycle(0f) val shadeToQsFraction by viewModel.shadeToQsFraction.collectAsStateWithLifecycle(0f) val topPadding = dimensionResource(id = R.dimen.notification_side_paddings) val navBarHeight = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding() Loading Loading @@ -385,14 +386,26 @@ fun SceneScope.NotificationScrollingStack( modifier .element(Notifications.Elements.NotificationScrim) .offset { // if scrim is expanded while transitioning to Gone scene, increase the offset // in step with the transition so that it is 0 when it completes. // if scrim is expanded while transitioning to Gone or QS scene, increase the // offset in step with the corresponding transition so that it is 0 when it // completes. if ( scrimOffset.value < 0 && layoutState.isTransitioning(from = Scenes.Shade, to = Scenes.Gone) || layoutState.isTransitioning(from = Scenes.Shade, to = Scenes.Lockscreen) ) { IntOffset(x = 0, y = (scrimOffset.value * expansionFraction).roundToInt()) } else if ( scrimOffset.value < 0 && layoutState.isTransitioning( from = Scenes.Shade, to = Scenes.QuickSettings ) ) { IntOffset( x = 0, y = (scrimOffset.value * (1 - shadeToQsFraction)).roundToInt() ) } else { IntOffset(x = 0, y = scrimOffset.value.roundToInt()) } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt +6 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,12 @@ constructor( */ val expandFraction: Flow<Float> = shadeInteractor.anyExpansion.dumpValue("expandFraction") /** * The amount [0-1] that quick settings has been opened. At 0, the shade may be open or closed; * at 1, the quick settings are open. */ val shadeToQsFraction: Flow<Float> = shadeInteractor.qsExpansion.dumpValue("shadeToQsFraction") /** * The amount in px that the notification stack should scroll due to internal expansion. This * should only happen when a notification expansion hits the bottom of the screen, so it is Loading