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

Commit 5105204d authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed the clear all animation on the locked shade

The notifications were also performing a removal animation
even though they were swiped out, which is not needed at all.
Also notifications that were clipped off on the top performed
an animation even though they shouldn't have.

Test: manual, on the shade locked clear all, observe smooth animations
Change-Id: I26c99a1fb48ea7b22e3710a744702af70db32b42
Fixes: 36590278
parent d43bc31e
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -2587,9 +2587,6 @@ public class NotificationStackScrollLayout extends ViewGroup
        }
        updateAnimationState(false, child);

        // Make sure the clipRect we might have set is removed
        expandableView.setClipTopAmount(0);

        focusNextViewIfFocused(child);
    }

@@ -3036,10 +3033,6 @@ public class NotificationStackScrollLayout extends ViewGroup
    private void generateChildRemovalEvents() {
        for (View child : mChildrenToRemoveAnimated) {
            boolean childWasSwipedOut = mSwipedOutViews.contains(child);
            int animationType = childWasSwipedOut
                    ? AnimationEvent.ANIMATION_TYPE_REMOVE_SWIPED_OUT
                    : AnimationEvent.ANIMATION_TYPE_REMOVE;
            AnimationEvent event = new AnimationEvent(child, animationType);

            // we need to know the view after this one
            float removedTranslation = child.getTranslationY();
@@ -3050,7 +3043,16 @@ public class NotificationStackScrollLayout extends ViewGroup
                    removedTranslation = row.getTranslationWhenRemoved();
                    ignoreChildren = false;
                }
                childWasSwipedOut |= Math.abs(row.getTranslation()) == row.getWidth();
            }
            if (!childWasSwipedOut) {
                Rect clipBounds = child.getClipBounds();
                childWasSwipedOut = clipBounds.height() == 0;
            }
            int animationType = childWasSwipedOut
                    ? AnimationEvent.ANIMATION_TYPE_REMOVE_SWIPED_OUT
                    : AnimationEvent.ANIMATION_TYPE_REMOVE;
            AnimationEvent event = new AnimationEvent(child, animationType);
            event.viewAfterChangingView = getFirstChildBelowTranlsationY(removedTranslation,
                    ignoreChildren);
            mAnimationEvents.add(event);