Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +28 −17 Original line number Original line Diff line number Diff line Loading @@ -531,12 +531,20 @@ fun ContentScope.NotificationScrollingStack( } } val scrimNestedScrollConnection = val scrimNestedScrollConnection = shadeSession.rememberSession(key = "ScrimConnection", scrimOffset, minScrimTop, density) { if (supportNestedScrolling) { shadeSession.rememberSession( key = "ScrimConnection", scrimOffset, minScrimTop, density, ) { val flingSpec: DecayAnimationSpec<Float> = splineBasedDecay(density) val flingSpec: DecayAnimationSpec<Float> = splineBasedDecay(density) val flingBehavior = NotificationScrimFlingBehavior(flingSpec) val flingBehavior = NotificationScrimFlingBehavior(flingSpec) NotificationScrimNestedScrollConnection( NotificationScrimNestedScrollConnection( scrimOffset = { scrimOffset.value }, scrimOffset = { scrimOffset.value }, snapScrimOffset = { value -> coroutineScope.launch { scrimOffset.snapTo(value) } }, snapScrimOffset = { value -> coroutineScope.launch { scrimOffset.snapTo(value) } }, animateScrimOffset = { value -> animateScrimOffset = { value -> coroutineScope.launch { scrimOffset.animateTo(value) } coroutineScope.launch { scrimOffset.animateTo(value) } }, }, Loading @@ -547,6 +555,9 @@ fun ContentScope.NotificationScrollingStack( flingBehavior = flingBehavior, flingBehavior = flingBehavior, ) ) } } } else { null } val swipeToExpandNotificationScrollConnection = val swipeToExpandNotificationScrollConnection = shadeSession.rememberSession( shadeSession.rememberSession( Loading Loading @@ -715,8 +726,8 @@ fun ContentScope.NotificationScrollingStack( modifier = modifier = Modifier.disableSwipesWhenScrolling() Modifier.disableSwipesWhenScrolling() .nestedScroll(swipeToExpandNotificationScrollConnection) .nestedScroll(swipeToExpandNotificationScrollConnection) .thenIf(supportNestedScrolling) { .thenIf(supportNestedScrolling && scrimNestedScrollConnection != null) { Modifier.nestedScroll(scrimNestedScrollConnection) Modifier.nestedScroll(scrimNestedScrollConnection!!) } } .verticalScroll(scrollState, overscrollEffect = overScrollEffect) .verticalScroll(scrollState, overscrollEffect = overScrollEffect) .fillMaxWidth() .fillMaxWidth() Loading packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt +2 −1 Original line number Original line Diff line number Diff line Loading @@ -387,6 +387,7 @@ private fun ContentScope.QuickSettingsContent( .padding(horizontal = shadeHorizontalPadding), .padding(horizontal = shadeHorizontalPadding), ) ) // TODO(b/436646848): remove NotificationScrollingStack from QuickSettings // The minimum possible value for the top of the notification stack. In other words: how // The minimum possible value for the top of the notification stack. In other words: how // high is the notification stack allowed to get when the scene is at rest. It may still be // high is the notification stack allowed to get when the scene is at rest. It may still be // translated farther upwards by a transition animation but, at rest, the top edge of its // translated farther upwards by a transition animation but, at rest, the top edge of its Loading @@ -406,7 +407,7 @@ private fun ContentScope.QuickSettingsContent( stackTopPadding = notificationStackPadding, stackTopPadding = notificationStackPadding, stackBottomPadding = navBarBottomHeight, stackBottomPadding = navBarBottomHeight, shouldIncludeHeadsUpSpace = false, shouldIncludeHeadsUpSpace = false, supportNestedScrolling = true, supportNestedScrolling = false, modifier = modifier = Modifier.fillMaxWidth() Modifier.fillMaxWidth() // Match the screen height with the scrim, so it covers the whole screen, // Match the screen height with the scrim, so it covers the whole screen, Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +28 −17 Original line number Original line Diff line number Diff line Loading @@ -531,12 +531,20 @@ fun ContentScope.NotificationScrollingStack( } } val scrimNestedScrollConnection = val scrimNestedScrollConnection = shadeSession.rememberSession(key = "ScrimConnection", scrimOffset, minScrimTop, density) { if (supportNestedScrolling) { shadeSession.rememberSession( key = "ScrimConnection", scrimOffset, minScrimTop, density, ) { val flingSpec: DecayAnimationSpec<Float> = splineBasedDecay(density) val flingSpec: DecayAnimationSpec<Float> = splineBasedDecay(density) val flingBehavior = NotificationScrimFlingBehavior(flingSpec) val flingBehavior = NotificationScrimFlingBehavior(flingSpec) NotificationScrimNestedScrollConnection( NotificationScrimNestedScrollConnection( scrimOffset = { scrimOffset.value }, scrimOffset = { scrimOffset.value }, snapScrimOffset = { value -> coroutineScope.launch { scrimOffset.snapTo(value) } }, snapScrimOffset = { value -> coroutineScope.launch { scrimOffset.snapTo(value) } }, animateScrimOffset = { value -> animateScrimOffset = { value -> coroutineScope.launch { scrimOffset.animateTo(value) } coroutineScope.launch { scrimOffset.animateTo(value) } }, }, Loading @@ -547,6 +555,9 @@ fun ContentScope.NotificationScrollingStack( flingBehavior = flingBehavior, flingBehavior = flingBehavior, ) ) } } } else { null } val swipeToExpandNotificationScrollConnection = val swipeToExpandNotificationScrollConnection = shadeSession.rememberSession( shadeSession.rememberSession( Loading Loading @@ -715,8 +726,8 @@ fun ContentScope.NotificationScrollingStack( modifier = modifier = Modifier.disableSwipesWhenScrolling() Modifier.disableSwipesWhenScrolling() .nestedScroll(swipeToExpandNotificationScrollConnection) .nestedScroll(swipeToExpandNotificationScrollConnection) .thenIf(supportNestedScrolling) { .thenIf(supportNestedScrolling && scrimNestedScrollConnection != null) { Modifier.nestedScroll(scrimNestedScrollConnection) Modifier.nestedScroll(scrimNestedScrollConnection!!) } } .verticalScroll(scrollState, overscrollEffect = overScrollEffect) .verticalScroll(scrollState, overscrollEffect = overScrollEffect) .fillMaxWidth() .fillMaxWidth() Loading
packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt +2 −1 Original line number Original line Diff line number Diff line Loading @@ -387,6 +387,7 @@ private fun ContentScope.QuickSettingsContent( .padding(horizontal = shadeHorizontalPadding), .padding(horizontal = shadeHorizontalPadding), ) ) // TODO(b/436646848): remove NotificationScrollingStack from QuickSettings // The minimum possible value for the top of the notification stack. In other words: how // The minimum possible value for the top of the notification stack. In other words: how // high is the notification stack allowed to get when the scene is at rest. It may still be // high is the notification stack allowed to get when the scene is at rest. It may still be // translated farther upwards by a transition animation but, at rest, the top edge of its // translated farther upwards by a transition animation but, at rest, the top edge of its Loading @@ -406,7 +407,7 @@ private fun ContentScope.QuickSettingsContent( stackTopPadding = notificationStackPadding, stackTopPadding = notificationStackPadding, stackBottomPadding = navBarBottomHeight, stackBottomPadding = navBarBottomHeight, shouldIncludeHeadsUpSpace = false, shouldIncludeHeadsUpSpace = false, supportNestedScrolling = true, supportNestedScrolling = false, modifier = modifier = Modifier.fillMaxWidth() Modifier.fillMaxWidth() // Match the screen height with the scrim, so it covers the whole screen, // Match the screen height with the scrim, so it covers the whole screen, Loading