Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −5 Original line number Diff line number Diff line Loading @@ -1416,17 +1416,20 @@ public class NotificationStackScrollLayout return; } createSortedNotificationLists(mTmpSortedChildren, mTmpNonOverlapChildren); // Now lets update the overlaps for the views, ensuring that we set the values for every // view, otherwise they might get stuck. mTmpNonOverlapChildren.forEach((child) -> { child.setBottomOverlap(0); child.setTopOverlap(0); }); // Now lets update the overlaps for the views, ensuring that we set the values for every // view, otherwise they might get stuck float minimumClipPosition = 0; // The NSSL can actually be inset and notifications even rendering above it. Let's make // sure that we don't clip them at 0 but use some large negative number (not min // because overflow) float minimumClipPosition = Integer.MIN_VALUE >> 1; ExpandableView lastTransientView = null; float transientClippingPosition = 0; float lastGroupEnd = 0; float transientClippingPosition = minimumClipPosition; float lastGroupEnd = minimumClipPosition; for (int i = 0; i < mTmpSortedChildren.size(); i++) { ExpandableView expandableView = mTmpSortedChildren.get(i); float currentTop = getRelativePosition(expandableView); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -1933,6 +1933,25 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { !nonOverlapList.contains(child)); } @Test @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT}) public void testOverlapWhenOutOfBounds() { ExpandableNotificationRow firstRow = mKosmos.createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); viewState.initFrom(firstRow); viewState.setYTranslation(-100f); viewState.height = 100; viewState.notGoneIndex = 0; viewState.applyToView(firstRow); mStackScroller.avoidNotificationOverlaps(); // bigger than because of padding assertTrue("TopOverlap not calculated accurately", firstRow.getTopOverlap() == 0); assertTrue("BottomOverlap not calculated accurately", firstRow.getBottomOverlap() == 0); } private MotionEvent captureTouchSentToSceneFramework() { ArgumentCaptor<MotionEvent> captor = ArgumentCaptor.forClass(MotionEvent.class); verify(mStackScrollLayoutController).sendTouchToSceneFramework(captor.capture()); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +8 −5 Original line number Diff line number Diff line Loading @@ -1416,17 +1416,20 @@ public class NotificationStackScrollLayout return; } createSortedNotificationLists(mTmpSortedChildren, mTmpNonOverlapChildren); // Now lets update the overlaps for the views, ensuring that we set the values for every // view, otherwise they might get stuck. mTmpNonOverlapChildren.forEach((child) -> { child.setBottomOverlap(0); child.setTopOverlap(0); }); // Now lets update the overlaps for the views, ensuring that we set the values for every // view, otherwise they might get stuck float minimumClipPosition = 0; // The NSSL can actually be inset and notifications even rendering above it. Let's make // sure that we don't clip them at 0 but use some large negative number (not min // because overflow) float minimumClipPosition = Integer.MIN_VALUE >> 1; ExpandableView lastTransientView = null; float transientClippingPosition = 0; float lastGroupEnd = 0; float transientClippingPosition = minimumClipPosition; float lastGroupEnd = minimumClipPosition; for (int i = 0; i < mTmpSortedChildren.size(); i++) { ExpandableView expandableView = mTmpSortedChildren.get(i); float currentTop = getRelativePosition(expandableView); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -1933,6 +1933,25 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { !nonOverlapList.contains(child)); } @Test @EnableFlags({com.android.systemui.Flags.FLAG_PHYSICAL_NOTIFICATION_MOVEMENT}) public void testOverlapWhenOutOfBounds() { ExpandableNotificationRow firstRow = mKosmos.createRow(); mStackScroller.addContainerView(firstRow); ExpandableViewState viewState = firstRow.getViewState(); viewState.initFrom(firstRow); viewState.setYTranslation(-100f); viewState.height = 100; viewState.notGoneIndex = 0; viewState.applyToView(firstRow); mStackScroller.avoidNotificationOverlaps(); // bigger than because of padding assertTrue("TopOverlap not calculated accurately", firstRow.getTopOverlap() == 0); assertTrue("BottomOverlap not calculated accurately", firstRow.getBottomOverlap() == 0); } private MotionEvent captureTouchSentToSceneFramework() { ArgumentCaptor<MotionEvent> captor = ArgumentCaptor.forClass(MotionEvent.class); verify(mStackScrollLayoutController).sendTouchToSceneFramework(captor.capture()); Loading