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 @@ -43,6 +43,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.imeAnimationTarget import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.safeDrawing import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.windowInsetsBottomHeight import androidx.compose.foundation.overscroll Loading Loading @@ -180,10 +181,12 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace( stackScrollView: NotificationScrollView, viewModel: NotificationsPlaceholderViewModel, ) { val isHeadsUp by viewModel.isHeadsUpOrAnimatingAway.collectAsStateWithLifecycle(false) var scrollOffset by remember { mutableFloatStateOf(0f) } val minScrollOffset = -(stackScrollView.getHeadsUpInset().toFloat()) val headsUpInset = with(LocalDensity.current) { headsUpTopInset().toPx() } val minScrollOffset = -headsUpInset val maxScrollOffset = 0f val scrollableState = rememberScrollableState { delta -> Loading Loading @@ -241,6 +244,12 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace( ) } /** Y position of the HUNs at rest, when the shade is closed. */ @Composable fun headsUpTopInset(): Dp = WindowInsets.safeDrawing.asPaddingValues().calculateTopPadding() + dimensionResource(R.dimen.heads_up_status_bar_padding) /** Adds the space where notification stack should appear in the scene. */ @Composable fun ContentScope.ConstrainedNotificationStack( Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/GoneScene.kt +5 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity import com.android.compose.animation.scene.SceneScope import com.android.compose.animation.scene.UserAction import com.android.compose.animation.scene.UserActionResult Loading @@ -34,6 +35,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.lifecycle.ExclusiveActivatable import com.android.systemui.lifecycle.rememberViewModel import com.android.systemui.notifications.ui.composable.SnoozeableHeadsUpNotificationSpace import com.android.systemui.notifications.ui.composable.headsUpTopInset import com.android.systemui.qs.ui.composable.QuickSettings import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaLandscapeTopOffset import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaOffset.Default Loading Loading @@ -78,6 +80,8 @@ constructor( } } val headsUpInset = with(LocalDensity.current) { headsUpTopInset().toPx() } LaunchedEffect(isIdleAndNotOccluded) { // Wait for being Idle on this Scene, otherwise LaunchedEffect would fire too soon, // and another transition could override the NSSL stack bounds. Loading @@ -86,7 +90,7 @@ constructor( // and not to confuse the StackScrollAlgorithm when it displays a HUN over GONE. notificationStackScrolLView.get().apply { // use -headsUpInset to allow HUN translation outside bounds for snoozing setStackTop(-getHeadsUpInset().toFloat()) setStackTop(-headsUpInset) setStackCutoff(0f) } } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +0 −6 Original line number Diff line number Diff line Loading @@ -2662,12 +2662,6 @@ public class NotificationStackScrollLayout return getTopHeadsUpIntrinsicHeight(); } @Override public int getHeadsUpInset() { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0; return mHeadsUpInset; } @Override public int getStackBottomInset() { return mPaddingBetweenElements + mShelf.getIntrinsicHeight(); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt +0 −3 Original line number Diff line number Diff line Loading @@ -106,9 +106,6 @@ interface NotificationScrollView { /** Sets whether the view is displayed in pulsing mode. */ fun setPulsing(pulsing: Boolean, animated: Boolean) /** Gets the inset for HUNs when they are not visible */ fun getHeadsUpInset(): Int /** * Signals that any open Notification guts should be closed, as scene container is handling * touch events. 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 @@ -43,6 +43,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.imeAnimationTarget import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.safeDrawing import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.windowInsetsBottomHeight import androidx.compose.foundation.overscroll Loading Loading @@ -180,10 +181,12 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace( stackScrollView: NotificationScrollView, viewModel: NotificationsPlaceholderViewModel, ) { val isHeadsUp by viewModel.isHeadsUpOrAnimatingAway.collectAsStateWithLifecycle(false) var scrollOffset by remember { mutableFloatStateOf(0f) } val minScrollOffset = -(stackScrollView.getHeadsUpInset().toFloat()) val headsUpInset = with(LocalDensity.current) { headsUpTopInset().toPx() } val minScrollOffset = -headsUpInset val maxScrollOffset = 0f val scrollableState = rememberScrollableState { delta -> Loading Loading @@ -241,6 +244,12 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace( ) } /** Y position of the HUNs at rest, when the shade is closed. */ @Composable fun headsUpTopInset(): Dp = WindowInsets.safeDrawing.asPaddingValues().calculateTopPadding() + dimensionResource(R.dimen.heads_up_status_bar_padding) /** Adds the space where notification stack should appear in the scene. */ @Composable fun ContentScope.ConstrainedNotificationStack( Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/GoneScene.kt +5 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity import com.android.compose.animation.scene.SceneScope import com.android.compose.animation.scene.UserAction import com.android.compose.animation.scene.UserActionResult Loading @@ -34,6 +35,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.lifecycle.ExclusiveActivatable import com.android.systemui.lifecycle.rememberViewModel import com.android.systemui.notifications.ui.composable.SnoozeableHeadsUpNotificationSpace import com.android.systemui.notifications.ui.composable.headsUpTopInset import com.android.systemui.qs.ui.composable.QuickSettings import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaLandscapeTopOffset import com.android.systemui.qs.ui.composable.QuickSettings.SharedValues.MediaOffset.Default Loading Loading @@ -78,6 +80,8 @@ constructor( } } val headsUpInset = with(LocalDensity.current) { headsUpTopInset().toPx() } LaunchedEffect(isIdleAndNotOccluded) { // Wait for being Idle on this Scene, otherwise LaunchedEffect would fire too soon, // and another transition could override the NSSL stack bounds. Loading @@ -86,7 +90,7 @@ constructor( // and not to confuse the StackScrollAlgorithm when it displays a HUN over GONE. notificationStackScrolLView.get().apply { // use -headsUpInset to allow HUN translation outside bounds for snoozing setStackTop(-getHeadsUpInset().toFloat()) setStackTop(-headsUpInset) setStackCutoff(0f) } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +0 −6 Original line number Diff line number Diff line Loading @@ -2662,12 +2662,6 @@ public class NotificationStackScrollLayout return getTopHeadsUpIntrinsicHeight(); } @Override public int getHeadsUpInset() { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0; return mHeadsUpInset; } @Override public int getStackBottomInset() { return mPaddingBetweenElements + mShelf.getIntrinsicHeight(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt +0 −3 Original line number Diff line number Diff line Loading @@ -106,9 +106,6 @@ interface NotificationScrollView { /** Sets whether the view is displayed in pulsing mode. */ fun setPulsing(pulsing: Boolean, animated: Boolean) /** Gets the inset for HUNs when they are not visible */ fun getHeadsUpInset(): Int /** * Signals that any open Notification guts should be closed, as scene container is handling * touch events. Loading