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

Commit 4fc661e7 authored by Selim Cinek's avatar Selim Cinek
Browse files

Made sure the shelf is properly clipped while pulsing

Also made sure that it's properly visible while expanding

Test: atest SystemUITests
Bug: 125942236
Change-Id: Iccdaa29015ac3ee4509778fb72ad4685a1b0a54b
parent 624d6caf
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -232,7 +232,8 @@ public class NotificationShelf extends ActivatableNotificationView implements
            openedAmount = Math.min(1.0f, openedAmount);
            viewState.openedAmount = openedAmount;
            viewState.clipTopAmount = 0;
            viewState.alpha = mAmbientState.hasPulsingNotifications() ? 0 : 1;
            viewState.alpha = mAmbientState.hasPulsingNotifications()
                    && !mAmbientState.isPulseExpanding() ? 0 : 1;
            viewState.belowSpeedBump = mAmbientState.getSpeedBumpIndex() == 0;
            viewState.hideSensitive = false;
            viewState.xTranslation = getTranslationX();
@@ -491,30 +492,34 @@ public class NotificationShelf extends ActivatableNotificationView implements
        }
    }

    /**
     * Update the clipping of this view.
     * @return the amount that our own top should be clipped
     */
    private int updateNotificationClipHeight(ExpandableNotificationRow row,
            float notificationClipEnd, int childIndex) {
        float viewEnd = row.getTranslationY() + row.getActualHeight();
        boolean isPinned = (row.isPinned() || row.isHeadsUpAnimatingAway())
                && !mAmbientState.isDozingAndNotPulsing(row);
        if (viewEnd > notificationClipEnd
        boolean shouldClipOwnTop = row.isAmbientPulsing()
                || (mAmbientState.isPulseExpanding() && childIndex == 0);
        if (viewEnd > notificationClipEnd && !shouldClipOwnTop
                && (mAmbientState.isShadeExpanded() || !isPinned)) {
            int clipBottomAmount = (int) (viewEnd - notificationClipEnd);
            if (isPinned) {
                clipBottomAmount = Math.min(row.getIntrinsicHeight() - row.getCollapsedHeight(),
                        clipBottomAmount);
            }
            if (!row.isAmbientPulsing()
                    && (!mAmbientState.isPulseExpanding() || childIndex != 0)) {
            row.setClipBottomAmount(clipBottomAmount);
        } else {
            row.setClipBottomAmount(0);
                return clipBottomAmount;
        }
        if (shouldClipOwnTop) {
            return (int) (viewEnd - getTranslationY());
        } else {
            row.setClipBottomAmount(0);
        }
            return 0;
        }
    }

    @Override
    public void setFakeShadowIntensity(float shadowIntensity, float outlineAlpha, int shadowYEnd,