Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6712c016 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed an issue where HUNs would be clipped on tablets" into main

parents 1788fd3d 28b24cbd
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -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);
+19 −0
Original line number Diff line number Diff line
@@ -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());