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

Commit dbe49843 authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge "Only clipping heads up that are not the first ones" into qt-r1-dev

parents 24907e82 3ff6f508
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -161,6 +161,7 @@ public class StackScrollAlgorithm {
                : 0;
                : 0;
        float clipStart = 0;
        float clipStart = 0;
        int childCount = algorithmState.visibleChildren.size();
        int childCount = algorithmState.visibleChildren.size();
        boolean firstHeadsUp = true;
        for (int i = 0; i < childCount; i++) {
        for (int i = 0; i < childCount; i++) {
            ExpandableView child = algorithmState.visibleChildren.get(i);
            ExpandableView child = algorithmState.visibleChildren.get(i);
            ExpandableViewState state = child.getViewState();
            ExpandableViewState state = child.getViewState();
@@ -173,7 +174,7 @@ public class StackScrollAlgorithm {
            boolean isHeadsUp = (child instanceof ExpandableNotificationRow)
            boolean isHeadsUp = (child instanceof ExpandableNotificationRow)
                    && ((ExpandableNotificationRow) child).isPinned();
                    && ((ExpandableNotificationRow) child).isPinned();
            if (mClipNotificationScrollToTop
            if (mClipNotificationScrollToTop
                    && (!state.inShelf || isHeadsUp)
                    && (!state.inShelf || (isHeadsUp && !firstHeadsUp))
                    && newYTranslation < clipStart) {
                    && newYTranslation < clipStart) {
                // The previous view is overlapping on top, clip!
                // The previous view is overlapping on top, clip!
                float overlapAmount = clipStart - newYTranslation;
                float overlapAmount = clipStart - newYTranslation;
@@ -181,7 +182,9 @@ public class StackScrollAlgorithm {
            } else {
            } else {
                state.clipTopAmount = 0;
                state.clipTopAmount = 0;
            }
            }

            if (isHeadsUp) {
                firstHeadsUp = false;
            }
            if (!child.isTransparent()) {
            if (!child.isTransparent()) {
                // Only update the previous values if we are not transparent,
                // Only update the previous values if we are not transparent,
                // otherwise we would clip to a transparent view.
                // otherwise we would clip to a transparent view.