summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt12
1 files changed, 5 insertions, 7 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 d7d4e1714aa6..09b8d178cc8e 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
@@ -175,7 +175,7 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace(
viewModel: NotificationsPlaceholderViewModel,
) {
- val isHeadsUp by viewModel.isHeadsUpOrAnimatingAway.collectAsStateWithLifecycle(false)
+ val isSnoozable by viewModel.isHeadsUpOrAnimatingAway.collectAsStateWithLifecycle(false)
var scrollOffset by remember { mutableFloatStateOf(0f) }
val headsUpInset = with(LocalDensity.current) { headsUpTopInset().toPx() }
@@ -192,7 +192,7 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace(
)
}
- val nestedScrollConnection =
+ val snoozeScrollConnection =
object : NestedScrollConnection {
override suspend fun onPreFling(available: Velocity): Velocity {
if (
@@ -206,7 +206,7 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace(
}
}
- LaunchedEffect(isHeadsUp) { scrollOffset = 0f }
+ LaunchedEffect(isSnoozable) { scrollOffset = 0f }
LaunchedEffect(scrollableState.isScrollInProgress) {
if (!scrollableState.isScrollInProgress && scrollOffset <= minScrollOffset) {
@@ -230,10 +230,8 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace(
),
)
}
- .thenIf(isHeadsUp) {
- Modifier.nestedScroll(nestedScrollConnection)
- .scrollable(orientation = Orientation.Vertical, state = scrollableState)
- },
+ .thenIf(isSnoozable) { Modifier.nestedScroll(snoozeScrollConnection) }
+ .scrollable(orientation = Orientation.Vertical, state = scrollableState),
)
}