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

Commit c0ef5650 authored by Arthur Hung's avatar Arthur Hung Committed by Selim Cinek
Browse files

FixBug: Round corner gone when scroll to non-first item and drag to close

Add some notification and scroll to non-first item,
Then drag to close notification panel, the top round corner will become
rectangle corner.

Case 1: the round corner only in first item.
Case 2: the round corner cross first and second.

Bug: 80110795
Test: add notifications, scroll, drag to close
Test: atest SystemUITest
Change-Id: I64146ebd1e3b7d19fd5b466290fc9fd5de5b8d5d
parent 3116918b
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -760,7 +760,9 @@ public class NotificationStackScrollLayout extends ViewGroup
    }
    }


    private void updateClippingToTopRoundedCorner() {
    private void updateClippingToTopRoundedCorner() {
        Float clipStart = (float) mTopPadding + mAmbientState.getExpandAnimationTopChange();
        Float clipStart = (float) mTopPadding
                                 + mStackTranslation
                                 + mAmbientState.getExpandAnimationTopChange();
        Float clipEnd = clipStart + mCornerRadius;
        Float clipEnd = clipStart + mCornerRadius;
        boolean first = true;
        boolean first = true;
        for (int i = 0; i < getChildCount(); i++) {
        for (int i = 0; i < getChildCount(); i++) {
@@ -769,8 +771,7 @@ public class NotificationStackScrollLayout extends ViewGroup
                continue;
                continue;
            }
            }
            float start = child.getTranslationY();
            float start = child.getTranslationY();
            float end = start + Math.max(child.getActualHeight() - child.getClipBottomAmount(),
            float end = start + child.getActualHeight();
                    0);
            boolean clip = clipStart > start && clipStart < end
            boolean clip = clipStart > start && clipStart < end
                    || clipEnd >= start && clipEnd <= end;
                    || clipEnd >= start && clipEnd <= end;
            clip &= !(first && mOwnScrollY == 0);
            clip &= !(first && mOwnScrollY == 0);