From 8a7e4c12d075128ce2213a6f59930de0aaebb194 Mon Sep 17 00:00:00 2001 From: AndrĂ¡s Kurucz Date: Mon, 17 Mar 2025 09:11:52 +0000 Subject: [Flexiglass] Use disableSwipesWhenScrolling for nested scrolling as well Modifier.disableSwipesWhenScrolling disables the STL user actions if anything below it in the Compose tree has consumed any non-zero scroll amount during the current gesture. This is important, because a swipe up can close the shade, and we don't want that to happen while the stack is being scrolled. This CL changes the orders of modifiers on the scrollable stack, so we do this behavior for both nested and regular scrolling. Bug: 394813692 Test: verify that a nested scroll doesn't close the shade - Open Single shade - Have enough notifications to scroll, BUT - Have a small enough scroll range that only needs nested scrolling - Scroll to the bottom with one long continuous motion - CHECK: the shade stays open Flag: com.android.systemui.scene_container Change-Id: I7624d9326192185a0d7e6a51616fc846892bbf26 --- .../com/android/systemui/notifications/ui/composable/Notifications.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt b/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt index 09b8d178cc8e..3e907e87c13b 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt @@ -574,11 +574,11 @@ fun ContentScope.NotificationScrollingStack( ) { Column( modifier = - Modifier.thenIf(supportNestedScrolling) { + Modifier.disableSwipesWhenScrolling(NestedScrollableBound.BottomRight) + .thenIf(supportNestedScrolling) { Modifier.nestedScroll(scrimNestedScrollConnection) } .stackVerticalOverscroll(coroutineScope) { scrollState.canScrollForward } - .disableSwipesWhenScrolling(NestedScrollableBound.BottomRight) .verticalScroll(scrollState) .padding(top = stackTopPadding, bottom = stackBottomPadding) .fillMaxWidth() -- cgit v1.2.3-59-g8ed1b