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

Commit 82d2074c authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Do not reset the previous state animation, if it is a part of the new...

Merge "Do not reset the previous state animation, if it is a part of the new state animaiton" into ub-launcher3-master
parents 97b658f2 b35f50cf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
            return false;
        }

        Animator childStateAnimation = null;
        // Found a visible recents task that matches the opening app, lets launch the app from there
        Animator launcherAnim;
        final AnimatorListenerAdapter windowAnimEndListener;
@@ -221,6 +222,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
                    mLauncher.getStateManager()
                            .createAnimationToNewWorkspace(NORMAL, RECENTS_LAUNCH_DURATION);
            controller.dispatchOnStart();
            childStateAnimation = controller.getOriginalTarget();
            launcherAnim = controller.getAnimationPlayer().setDuration(RECENTS_LAUNCH_DURATION);
            windowAnimEndListener = new AnimatorListenerAdapter() {
                @Override
@@ -237,7 +239,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
        // Set the current animation first, before adding windowAnimEndListener. Setting current
        // animation adds some listeners which need to be called before windowAnimEndListener
        // (the ordering of listeners matter in this case).
        mLauncher.getStateManager().setCurrentAnimation(target);
        mLauncher.getStateManager().setCurrentAnimation(target, childStateAnimation);
        target.addListener(windowAnimEndListener);
        return true;
    }
+10 −1
Original line number Diff line number Diff line
@@ -354,8 +354,17 @@ public class LauncherStateManager {
    /**
     * Sets the animation as the current state animation, i.e., canceled when
     * starting another animation and may block some launcher interactions while running.
     *
     * @param childAnimations Set of animations with the new target is controlling.
     */
    public void setCurrentAnimation(AnimatorSet anim) {
    public void setCurrentAnimation(AnimatorSet anim, Animator... childAnimations) {
        for (Animator childAnim : childAnimations) {
            if (childAnim != null && mConfig.mCurrentAnimation == childAnim) {
                mConfig.mCurrentAnimation.removeListener(mConfig);
                mConfig.mCurrentAnimation = null;
                break;
            }
        }
        boolean reapplyNeeded = mConfig.mCurrentAnimation != null;
        cancelAnimation();
        if (reapplyNeeded) {