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

Commit 7899902b authored by Jon Miranda's avatar Jon Miranda Committed by Jonathan Miranda
Browse files

Ensure current animation is cancelled before building new folder animation.

Fixes bug where folder clip padding gets stuck as false.

Bug: 146884730
Change-Id: I3a24e561d15fbc46837bb21cd8f97283e69f9ce1
(cherry picked from commit 9794d4d5)
parent 66dc70c9
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -445,9 +445,6 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
    }

    private void startAnimation(final AnimatorSet a) {
        if (mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
            mCurrentAnimator.cancel();
        }
        final Workspace workspace = mLauncher.getWorkspace();
        final CellLayout currentCellLayout =
                (CellLayout) workspace.getChildAt(workspace.getCurrentPage());
@@ -553,6 +550,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
        // dropping. One resulting issue is that replaceFolderWithFinalItem() can be called twice.
        mDeleteFolderOnDropCompleted = false;

        if (mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
            mCurrentAnimator.cancel();
        }
        AnimatorSet anim = new FolderAnimationManager(this, true /* isOpening */).getAnimator();
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
@@ -653,6 +653,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
    }

    private void animateClosed() {
        if (mCurrentAnimator != null && mCurrentAnimator.isRunning()) {
            mCurrentAnimator.cancel();
        }
        AnimatorSet a = new FolderAnimationManager(this, false /* isOpening */).getAnimator();
        a.addListener(new AnimatorListenerAdapter() {
            @Override