Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +6 −1 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ fun SceneScope.HeadsUpNotificationSpace( } // Note: boundsInWindow doesn't scroll off the screen stackScrollView.setHeadsUpTop(boundsInWindow.top) stackScrollView.setHeadsUpBottom(boundsInWindow.bottom) } ) } Loading Loading @@ -471,7 +472,11 @@ fun SceneScope.NotificationScrollingStack( ) } if (shouldIncludeHeadsUpSpace) { HeadsUpNotificationSpace(stackScrollView = stackScrollView, viewModel = viewModel) HeadsUpNotificationSpace( stackScrollView = stackScrollView, viewModel = viewModel, modifier = Modifier.padding(top = topPadding) ) } } } Loading packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt +1 −1 Original line number Diff line number Diff line Loading @@ -408,7 +408,7 @@ private fun SceneScope.QuickSettingsScene( HeadsUpNotificationSpace( stackScrollView = notificationStackScrollView, viewModel = notificationsPlaceholderViewModel, modifier = Modifier.align(Alignment.BottomCenter), modifier = Modifier.align(Alignment.BottomCenter).navigationBarsPadding(), isPeekFromBottom = true, ) NotificationScrollingStack( Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +29 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ public class AmbientState implements Dumpable { private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private float mStackTop; private float mStackCutoff; private float mHeadsUpTop; private float mHeadsUpBottom; private int mScrollY; private float mOverScrollTopAmount; private float mOverScrollBottomAmount; Loading Loading @@ -377,6 +379,30 @@ public class AmbientState implements Dumpable { this.mStackCutoff = stackCutoff; } /** y coordinate of the top position of a pinned HUN */ public float getHeadsUpTop() { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0f; return mHeadsUpTop; } /** @see #getHeadsUpTop() */ public void setHeadsUpTop(float mHeadsUpTop) { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return; this.mHeadsUpTop = mHeadsUpTop; } /** the bottom-most y position where we can draw pinned HUNs */ public float getHeadsUpBottom() { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0f; return mHeadsUpBottom; } /** @see #getHeadsUpBottom() */ public void setHeadsUpBottom(float headsUpBottom) { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return; mHeadsUpBottom = headsUpBottom; } public int getScrollY() { return mScrollY; } Loading Loading @@ -784,7 +810,9 @@ public class AmbientState implements Dumpable { @Override public void dump(PrintWriter pw, String[] args) { pw.println("mStackTop=" + mStackTop); pw.println("mStackCutoff" + mStackCutoff); pw.println("mStackCutoff=" + mStackCutoff); pw.println("mHeadsUpTop=" + mHeadsUpTop); pw.println("mHeadsUpBottom=" + mHeadsUpBottom); pw.println("mTopPadding=" + mTopPadding); pw.println("mStackTopMargin=" + mStackTopMargin); pw.println("mStackTranslation=" + mStackTranslation); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −2 Original line number Diff line number Diff line Loading @@ -834,7 +834,7 @@ public class NotificationStackScrollLayout y = (int) mAmbientState.getStackCutoff(); drawDebugInfo(canvas, y, Color.MAGENTA, /* label= */ "getStackCutoff() = " + y); y = (int) mScrollViewFields.getHeadsUpTop(); y = (int) mAmbientState.getHeadsUpTop(); drawDebugInfo(canvas, y, Color.GREEN, /* label= */ "getHeadsUpTop() = " + y); y += getTopHeadsUpHeight(); Loading Loading @@ -1222,7 +1222,12 @@ public class NotificationStackScrollLayout @Override public void setHeadsUpTop(float headsUpTop) { mScrollViewFields.setHeadsUpTop(headsUpTop); mAmbientState.setHeadsUpTop(headsUpTop); } @Override public void setHeadsUpBottom(float headsUpBottom) { mAmbientState.setHeadsUpBottom(headsUpBottom); } @Override Loading Loading @@ -4894,6 +4899,7 @@ public class NotificationStackScrollLayout * @param bottomBarHeight the height of the bar on the bottom */ public void setHeadsUpBoundaries(int height, int bottomBarHeight) { SceneContainerFlag.assertInLegacyMode(); mAmbientState.setMaxHeadsUpTranslation(height - bottomBarHeight); mStackScrollAlgorithm.setHeadsUpAppearHeightBottom(height); mStateAnimator.setHeadsUpAppearHeightBottom(height); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ScrollViewFields.kt +0 −3 Original line number Diff line number Diff line Loading @@ -32,8 +32,6 @@ import java.util.function.Consumer class ScrollViewFields { /** Used to produce the clipping path */ var scrimClippingShape: ShadeScrimShape? = null /** Y coordinate in view pixels of the top of the HUN */ var headsUpTop: Float = 0f /** Whether the notifications are scrolled all the way to the top (i.e. when freshly opened) */ var isScrolledToTop: Boolean = true Loading Loading @@ -74,7 +72,6 @@ class ScrollViewFields { fun dump(pw: IndentingPrintWriter) { pw.printSection("StackViewStates") { pw.println("scrimClippingShape", scrimClippingShape) pw.println("headsUpTop", headsUpTop) pw.println("isScrolledToTop", isScrolledToTop) } } Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +6 −1 Original line number Diff line number Diff line Loading @@ -145,6 +145,7 @@ fun SceneScope.HeadsUpNotificationSpace( } // Note: boundsInWindow doesn't scroll off the screen stackScrollView.setHeadsUpTop(boundsInWindow.top) stackScrollView.setHeadsUpBottom(boundsInWindow.bottom) } ) } Loading Loading @@ -471,7 +472,11 @@ fun SceneScope.NotificationScrollingStack( ) } if (shouldIncludeHeadsUpSpace) { HeadsUpNotificationSpace(stackScrollView = stackScrollView, viewModel = viewModel) HeadsUpNotificationSpace( stackScrollView = stackScrollView, viewModel = viewModel, modifier = Modifier.padding(top = topPadding) ) } } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt +1 −1 Original line number Diff line number Diff line Loading @@ -408,7 +408,7 @@ private fun SceneScope.QuickSettingsScene( HeadsUpNotificationSpace( stackScrollView = notificationStackScrollView, viewModel = notificationsPlaceholderViewModel, modifier = Modifier.align(Alignment.BottomCenter), modifier = Modifier.align(Alignment.BottomCenter).navigationBarsPadding(), isPeekFromBottom = true, ) NotificationScrollingStack( Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/AmbientState.java +29 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ public class AmbientState implements Dumpable { private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private float mStackTop; private float mStackCutoff; private float mHeadsUpTop; private float mHeadsUpBottom; private int mScrollY; private float mOverScrollTopAmount; private float mOverScrollBottomAmount; Loading Loading @@ -377,6 +379,30 @@ public class AmbientState implements Dumpable { this.mStackCutoff = stackCutoff; } /** y coordinate of the top position of a pinned HUN */ public float getHeadsUpTop() { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0f; return mHeadsUpTop; } /** @see #getHeadsUpTop() */ public void setHeadsUpTop(float mHeadsUpTop) { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return; this.mHeadsUpTop = mHeadsUpTop; } /** the bottom-most y position where we can draw pinned HUNs */ public float getHeadsUpBottom() { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0f; return mHeadsUpBottom; } /** @see #getHeadsUpBottom() */ public void setHeadsUpBottom(float headsUpBottom) { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return; mHeadsUpBottom = headsUpBottom; } public int getScrollY() { return mScrollY; } Loading Loading @@ -784,7 +810,9 @@ public class AmbientState implements Dumpable { @Override public void dump(PrintWriter pw, String[] args) { pw.println("mStackTop=" + mStackTop); pw.println("mStackCutoff" + mStackCutoff); pw.println("mStackCutoff=" + mStackCutoff); pw.println("mHeadsUpTop=" + mHeadsUpTop); pw.println("mHeadsUpBottom=" + mHeadsUpBottom); pw.println("mTopPadding=" + mTopPadding); pw.println("mStackTopMargin=" + mStackTopMargin); pw.println("mStackTranslation=" + mStackTranslation); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −2 Original line number Diff line number Diff line Loading @@ -834,7 +834,7 @@ public class NotificationStackScrollLayout y = (int) mAmbientState.getStackCutoff(); drawDebugInfo(canvas, y, Color.MAGENTA, /* label= */ "getStackCutoff() = " + y); y = (int) mScrollViewFields.getHeadsUpTop(); y = (int) mAmbientState.getHeadsUpTop(); drawDebugInfo(canvas, y, Color.GREEN, /* label= */ "getHeadsUpTop() = " + y); y += getTopHeadsUpHeight(); Loading Loading @@ -1222,7 +1222,12 @@ public class NotificationStackScrollLayout @Override public void setHeadsUpTop(float headsUpTop) { mScrollViewFields.setHeadsUpTop(headsUpTop); mAmbientState.setHeadsUpTop(headsUpTop); } @Override public void setHeadsUpBottom(float headsUpBottom) { mAmbientState.setHeadsUpBottom(headsUpBottom); } @Override Loading Loading @@ -4894,6 +4899,7 @@ public class NotificationStackScrollLayout * @param bottomBarHeight the height of the bar on the bottom */ public void setHeadsUpBoundaries(int height, int bottomBarHeight) { SceneContainerFlag.assertInLegacyMode(); mAmbientState.setMaxHeadsUpTranslation(height - bottomBarHeight); mStackScrollAlgorithm.setHeadsUpAppearHeightBottom(height); mStateAnimator.setHeadsUpAppearHeightBottom(height); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ScrollViewFields.kt +0 −3 Original line number Diff line number Diff line Loading @@ -32,8 +32,6 @@ import java.util.function.Consumer class ScrollViewFields { /** Used to produce the clipping path */ var scrimClippingShape: ShadeScrimShape? = null /** Y coordinate in view pixels of the top of the HUN */ var headsUpTop: Float = 0f /** Whether the notifications are scrolled all the way to the top (i.e. when freshly opened) */ var isScrolledToTop: Boolean = true Loading Loading @@ -74,7 +72,6 @@ class ScrollViewFields { fun dump(pw: IndentingPrintWriter) { pw.printSection("StackViewStates") { pw.println("scrimClippingShape", scrimClippingShape) pw.println("headsUpTop", headsUpTop) pw.println("isScrolledToTop", isScrolledToTop) } } Loading