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

Commit 6487ebff authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed the inline launch animation for notification groups

When launching a child of a group there would be strange artifacts
from the clipping. These are now fixed. Also made sure that
the notification can't be launched if the parent is translated.

Test: launch child in a group, observe normal animation
Change-Id: Iee8e4b49462e140d3eaffe5b2504caa1b67d04e2
Fixes: 110093221
parent cce6c22e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -176,9 +176,12 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
            }

            // Check if the notification is displaying the menu, if so slide notification back
            if (row.getProvider() != null && row.getProvider().isMenuVisible()) {
            if (isMenuVisible(row)) {
                row.animateTranslateNotification(0);
                return;
            } else if (row.isChildInGroup() && isMenuVisible(row.getNotificationParent())) {
                row.getNotificationParent().animateTranslateNotification(0);
                return;
            }

            // Mark notification for one frame.
@@ -193,6 +196,10 @@ public class NotificationEntryManager implements Dumpable, NotificationInflater.
            mCallback.onNotificationClicked(sbn, row);
        }

        private boolean isMenuVisible(ExpandableNotificationRow row) {
            return row.getProvider() != null && row.getProvider().isMenuVisible();
        }

        public void register(ExpandableNotificationRow row, StatusBarNotification sbn) {
            Notification notification = sbn.getNotification();
            if (notification.contentIntent != null || notification.fullScreenIntent != null) {
+3 −1
Original line number Diff line number Diff line
@@ -2067,6 +2067,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView

    private void setChildIsExpanding(boolean isExpanding) {
        mChildIsExpanding = isExpanding;
        updateClipping();
        invalidate();
    }

    @Override
@@ -2968,7 +2970,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                return true;
            }
        } else if (child == mChildrenContainer) {
            if (!mChildIsExpanding && (isClippingNeeded() || !hasNoRounding())) {
            if (isClippingNeeded() || !hasNoRounding()) {
                return true;
            }
        } else if (child instanceof NotificationGuts) {
+7 −3
Original line number Diff line number Diff line
@@ -115,12 +115,14 @@ public abstract class ExpandableOutlineView extends ExpandableView {
        if (!mCustomOutline) {
            int translation = mShouldTranslateContents && !ignoreTranslation
                    ? (int) getTranslation() : 0;
            left = Math.max(translation, 0);
            int halfExtraWidth = (int) (mExtraWidthForClipping / 2.0f);
            left = Math.max(translation, 0) - halfExtraWidth;
            top = mClipTopAmount + mBackgroundTop;
            right = getWidth() + Math.min(translation, 0);
            right = getWidth() + halfExtraWidth + Math.min(translation, 0);
            // If the top is rounded we want the bottom to be at most at the top roundness, in order
            // to avoid the shadow changing when scrolling up.
            bottom = Math.max(getActualHeight() - mClipBottomAmount, (int) (top + topRoundness));
            bottom = Math.max(mMinimumHeightForClipping,
                    Math.max(getActualHeight() - mClipBottomAmount, (int) (top + topRoundness)));
        } else {
            left = mOutlineRect.left;
            top = mOutlineRect.top;
@@ -219,10 +221,12 @@ public abstract class ExpandableOutlineView extends ExpandableView {

    public void setExtraWidthForClipping(float extraWidthForClipping) {
        mExtraWidthForClipping = extraWidthForClipping;
        invalidate();
    }

    public void setMinimumHeightForClipping(int minimumHeightForClipping) {
        mMinimumHeightForClipping = minimumHeightForClipping;
        invalidate();
    }

    @Override