Loading packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +2 −4 Original line number Diff line number Diff line Loading @@ -262,8 +262,7 @@ fun ContentScope.ConstrainedNotificationStack( .onSizeChanged { viewModel.onConstrainedAvailableSpaceChanged(it.height) } .onGloballyPositioned { if (shouldUseLockscreenStackBounds(layoutState.transitionState)) { // TODO(417965077) correct drawBounds for the horizontal padding of the NSSL stackScrollView.setDrawBounds(it.boundsInWindow().toAndroidRectF()) stackScrollView.updateDrawBounds(it.boundsInWindow().toAndroidRectF()) } } ) { Loading Loading @@ -634,8 +633,7 @@ fun ContentScope.NotificationScrollingStack( ) .onGloballyPositioned { if (!shouldUseLockscreenStackBounds(layoutState.transitionState)) { // TODO(417965077) correct for the horizontal padding of the NSSL stackScrollView.setDrawBounds(it.boundsInWindow().toAndroidRectF()) stackScrollView.updateDrawBounds(it.boundsInWindow().toAndroidRectF()) } } .debugBackground(viewModel, DEBUG_BOX_COLOR) Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/GoneScene.kt +1 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ constructor( notificationStackScrolLView.get().apply { // use -headsUpInset to allow HUN translation outside bounds for snoozing setStackTop(-headsUpInset) setDrawBounds(RectF()) updateDrawBounds(RectF()) } } } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -369,7 +369,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { // WHEN stackBottom changes final float newStackBottom = 800; mStackScroller.setDrawBounds(new RectF(0, stackTop, 400, newStackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, 400, newStackBottom)); // THEN stackEndHeight is updated final float newStackHeight = newStackBottom - stackTop; Loading Loading @@ -467,7 +467,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { float stackHeight = stackBottom - stackTop; float stackWidth = 400; mStackScroller.setStackTop(stackTop); mStackScroller.setDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); // When: panel is expanding mStackScroller.setExpandFraction(expandFraction); Loading Loading @@ -496,7 +496,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { float stackHeight = stackBottom - stackTop; float stackWidth = 400; mStackScroller.setStackTop(stackTop); mStackScroller.setDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); // When: panel is fully expanded mStackScroller.setExpandFraction(expandFraction); Loading Loading @@ -1059,7 +1059,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { float stackWidth = 400; float stackViewPortHeight = stackBottom - stackTop; mStackScroller.setStackTop(stackTop); mStackScroller.setDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); when(mStackSizeCalculator.computeHeight( eq(mStackScroller), eq(-1), Loading Loading @@ -1097,7 +1097,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { float stackBottom = 1100; float stackWidth = 400; mStackScroller.setStackTop(stackTop); mStackScroller.setDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); // Given we have a limit on max displayed notifications int stackHeightBeforeUpdate = 100; Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +4 −1 Original line number Diff line number Diff line Loading @@ -1296,8 +1296,11 @@ public class NotificationStackScrollLayout } @Override public void setDrawBounds(@NotNull RectF drawBounds) { public void updateDrawBounds(@NotNull RectF drawBounds) { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return; // The received drawBounds are relative to the Window, but NSSL expects a rect relative to // its own position, so we need to offset it in case the NSSL has some horizontal margins. drawBounds.offset(-getX(), 0f); if (mAmbientState.getDrawBounds() != drawBounds) { mAmbientState.setDrawBounds(drawBounds); updateStackEndHeightAndStackHeight(mAmbientState.getExpansionFraction()); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ interface NotificationScrollView { fun setStackTop(stackTop: Float) /** set the area where this can place its content */ fun setDrawBounds(bounds: RectF) fun updateDrawBounds(boundsInWindow: RectF) /** set the y position in px of the top of the HUN in this view's coordinates */ fun setHeadsUpTop(headsUpTop: Float) Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt +2 −4 Original line number Diff line number Diff line Loading @@ -262,8 +262,7 @@ fun ContentScope.ConstrainedNotificationStack( .onSizeChanged { viewModel.onConstrainedAvailableSpaceChanged(it.height) } .onGloballyPositioned { if (shouldUseLockscreenStackBounds(layoutState.transitionState)) { // TODO(417965077) correct drawBounds for the horizontal padding of the NSSL stackScrollView.setDrawBounds(it.boundsInWindow().toAndroidRectF()) stackScrollView.updateDrawBounds(it.boundsInWindow().toAndroidRectF()) } } ) { Loading Loading @@ -634,8 +633,7 @@ fun ContentScope.NotificationScrollingStack( ) .onGloballyPositioned { if (!shouldUseLockscreenStackBounds(layoutState.transitionState)) { // TODO(417965077) correct for the horizontal padding of the NSSL stackScrollView.setDrawBounds(it.boundsInWindow().toAndroidRectF()) stackScrollView.updateDrawBounds(it.boundsInWindow().toAndroidRectF()) } } .debugBackground(viewModel, DEBUG_BOX_COLOR) Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/GoneScene.kt +1 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ constructor( notificationStackScrolLView.get().apply { // use -headsUpInset to allow HUN translation outside bounds for snoozing setStackTop(-headsUpInset) setDrawBounds(RectF()) updateDrawBounds(RectF()) } } } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +5 −5 Original line number Diff line number Diff line Loading @@ -369,7 +369,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { // WHEN stackBottom changes final float newStackBottom = 800; mStackScroller.setDrawBounds(new RectF(0, stackTop, 400, newStackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, 400, newStackBottom)); // THEN stackEndHeight is updated final float newStackHeight = newStackBottom - stackTop; Loading Loading @@ -467,7 +467,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { float stackHeight = stackBottom - stackTop; float stackWidth = 400; mStackScroller.setStackTop(stackTop); mStackScroller.setDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); // When: panel is expanding mStackScroller.setExpandFraction(expandFraction); Loading Loading @@ -496,7 +496,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { float stackHeight = stackBottom - stackTop; float stackWidth = 400; mStackScroller.setStackTop(stackTop); mStackScroller.setDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); // When: panel is fully expanded mStackScroller.setExpandFraction(expandFraction); Loading Loading @@ -1059,7 +1059,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { float stackWidth = 400; float stackViewPortHeight = stackBottom - stackTop; mStackScroller.setStackTop(stackTop); mStackScroller.setDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); when(mStackSizeCalculator.computeHeight( eq(mStackScroller), eq(-1), Loading Loading @@ -1097,7 +1097,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { float stackBottom = 1100; float stackWidth = 400; mStackScroller.setStackTop(stackTop); mStackScroller.setDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); mStackScroller.updateDrawBounds(new RectF(0, stackTop, stackWidth, stackBottom)); // Given we have a limit on max displayed notifications int stackHeightBeforeUpdate = 100; Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +4 −1 Original line number Diff line number Diff line Loading @@ -1296,8 +1296,11 @@ public class NotificationStackScrollLayout } @Override public void setDrawBounds(@NotNull RectF drawBounds) { public void updateDrawBounds(@NotNull RectF drawBounds) { if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return; // The received drawBounds are relative to the Window, but NSSL expects a rect relative to // its own position, so we need to offset it in case the NSSL has some horizontal margins. drawBounds.offset(-getX(), 0f); if (mAmbientState.getDrawBounds() != drawBounds) { mAmbientState.setDrawBounds(drawBounds); updateStackEndHeightAndStackHeight(mAmbientState.getExpansionFraction()); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ interface NotificationScrollView { fun setStackTop(stackTop: Float) /** set the area where this can place its content */ fun setDrawBounds(bounds: RectF) fun updateDrawBounds(boundsInWindow: RectF) /** set the y position in px of the top of the HUN in this view's coordinates */ fun setHeadsUpTop(headsUpTop: Float) Loading