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

Commit 0b0c173e authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge "Ensure taskbar animation ends when running window animation does" into sc-dev

parents c9846dc6 9f436dfe
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -217,6 +217,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,

    // Either RectFSpringAnim (if animating home) or ObjectAnimator (from mCurrentShift) otherwise
    private RunningWindowAnim mRunningWindowAnim;
    // Possible second animation running at the same time as mRunningWindowAnim
    private Animator mParallelRunningAnim;
    private boolean mIsMotionPaused;
    private boolean mHasMotionEverBeenPaused;

@@ -798,6 +800,13 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                mRunningWindowAnim.end();
            }
        }
        if (mParallelRunningAnim != null) {
            if (cancel) {
                mParallelRunningAnim.cancel();
            } else {
                mParallelRunningAnim.end();
            }
        }
    }

    private void onSettledOnEndTarget() {
@@ -1060,7 +1069,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
            ActivityManagerWrapper.getInstance().registerTaskStackListener(
                    mActivityRestartListener);

            mActivityInterface.onAnimateToLauncher(mGestureState.getEndTarget(), duration);
            mParallelRunningAnim = mActivityInterface.getParallelAnimationToLauncher(
                    mGestureState.getEndTarget(), duration);
            if (mParallelRunningAnim != null) {
                mParallelRunningAnim.start();
            }
        }

        if (mGestureState.getEndTarget() == HOME) {
+3 −1
Original line number Diff line number Diff line
@@ -347,7 +347,9 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
     * Called when the gesture ends and the animation starts towards the given target. No-op by
     * default, but subclasses can override to add an additional animation with the same duration.
     */
    public void onAnimateToLauncher(GestureState.GestureEndTarget endTarget, long duration) {
    public @Nullable Animator getParallelAnimationToLauncher(
            GestureState.GestureEndTarget endTarget, long duration) {
        return null;
    }

    /**
+5 −3
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static com.android.launcher3.LauncherState.QUICK_SWITCH;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;

import android.animation.Animator;
import android.content.Context;
import android.graphics.Rect;
import android.view.MotionEvent;
@@ -267,13 +268,14 @@ public final class LauncherActivityInterface extends
    }

    @Override
    public void onAnimateToLauncher(GestureEndTarget endTarget, long duration) {
    public @Nullable Animator getParallelAnimationToLauncher(GestureEndTarget endTarget,
            long duration) {
        TaskbarController taskbarController = getTaskbarController();
        if (taskbarController == null) {
            return;
            return null;
        }
        LauncherState toState = stateFromGestureEndTarget(endTarget);
        taskbarController.createAnimToLauncher(toState, duration).start();
        return taskbarController.createAnimToLauncher(toState, duration);
    }

    @Override