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

Commit 35cde20a authored by Winson Chung's avatar Winson Chung
Browse files

Tweaking quickscrub launch animation for new task sizes.

Bug: 79945202
Change-Id: Ibe1e53d45bc3fda325cebc14aa6a61f61f08edb0
parent 5d6282fc
Loading
Loading
Loading
Loading
+11 −5
Original line number Original line Diff line number Diff line
@@ -105,6 +105,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
    private static final int APP_LAUNCH_ALPHA_DURATION = 50;
    private static final int APP_LAUNCH_ALPHA_DURATION = 50;


    public static final int RECENTS_LAUNCH_DURATION = 336;
    public static final int RECENTS_LAUNCH_DURATION = 336;
    public static final int RECENTS_QUICKSCRUB_LAUNCH_DURATION = 300;
    private static final int LAUNCHER_RESUME_START_DELAY = 100;
    private static final int LAUNCHER_RESUME_START_DELAY = 100;
    private static final int CLOSING_TRANSITION_DURATION_MS = 250;
    private static final int CLOSING_TRANSITION_DURATION_MS = 250;


@@ -253,15 +254,21 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
        RecentsView recentsView = mLauncher.getOverviewPanel();
        RecentsView recentsView = mLauncher.getOverviewPanel();
        boolean launcherClosing = launcherIsATargetWithMode(targets, MODE_CLOSING);
        boolean launcherClosing = launcherIsATargetWithMode(targets, MODE_CLOSING);
        boolean skipLauncherChanges = !launcherClosing;
        boolean skipLauncherChanges = !launcherClosing;
        boolean isLaunchingFromQuickscrub =
                recentsView.getQuickScrubController().isWaitingForTaskLaunch();


        TaskView taskView = findTaskViewToLaunch(mLauncher, v, targets);
        TaskView taskView = findTaskViewToLaunch(mLauncher, v, targets);
        if (taskView == null) {
        if (taskView == null) {
            return false;
            return false;
        }
        }


        int duration = isLaunchingFromQuickscrub
                ? RECENTS_QUICKSCRUB_LAUNCH_DURATION
                : RECENTS_LAUNCH_DURATION;

        ClipAnimationHelper helper = new ClipAnimationHelper();
        ClipAnimationHelper helper = new ClipAnimationHelper();
        target.play(getRecentsWindowAnimator(taskView, skipLauncherChanges, targets, helper)
        target.play(getRecentsWindowAnimator(taskView, skipLauncherChanges, targets, helper)
                .setDuration(RECENTS_LAUNCH_DURATION));
                .setDuration(duration));


        Animator childStateAnimation = null;
        Animator childStateAnimation = null;
        // Found a visible recents task that matches the opening app, lets launch the app from there
        // Found a visible recents task that matches the opening app, lets launch the app from there
@@ -270,7 +277,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
        if (launcherClosing) {
        if (launcherClosing) {
            launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView, helper);
            launcherAnim = recentsView.createAdjacentPageAnimForTaskLaunch(taskView, helper);
            launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR);
            launcherAnim.setInterpolator(Interpolators.TOUCH_RESPONSE_INTERPOLATOR);
            launcherAnim.setDuration(RECENTS_LAUNCH_DURATION);
            launcherAnim.setDuration(duration);


            // Make sure recents gets fixed up by resetting task alphas and scales, etc.
            // Make sure recents gets fixed up by resetting task alphas and scales, etc.
            windowAnimEndListener = new AnimatorListenerAdapter() {
            windowAnimEndListener = new AnimatorListenerAdapter() {
@@ -282,11 +289,10 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
            };
            };
        } else {
        } else {
            AnimatorPlaybackController controller =
            AnimatorPlaybackController controller =
                    mLauncher.getStateManager()
                    mLauncher.getStateManager().createAnimationToNewWorkspace(NORMAL, duration);
                            .createAnimationToNewWorkspace(NORMAL, RECENTS_LAUNCH_DURATION);
            controller.dispatchOnStart();
            controller.dispatchOnStart();
            childStateAnimation = controller.getTarget();
            childStateAnimation = controller.getTarget();
            launcherAnim = controller.getAnimationPlayer().setDuration(RECENTS_LAUNCH_DURATION);
            launcherAnim = controller.getAnimationPlayer().setDuration(duration);
            windowAnimEndListener = new AnimatorListenerAdapter() {
            windowAnimEndListener = new AnimatorListenerAdapter() {
                @Override
                @Override
                public void onAnimationEnd(Animator animation) {
                public void onAnimationEnd(Animator animation) {
+5 −1
Original line number Original line Diff line number Diff line
@@ -40,7 +40,7 @@ import com.android.quickstep.views.TaskView;
public class QuickScrubController implements OnAlarmListener {
public class QuickScrubController implements OnAlarmListener {


    public static final int QUICK_SCRUB_FROM_APP_START_DURATION = 240;
    public static final int QUICK_SCRUB_FROM_APP_START_DURATION = 240;
    public static final int QUICK_SCRUB_FROM_HOME_START_DURATION = 150;
    public static final int QUICK_SCRUB_FROM_HOME_START_DURATION = 200;
    // We want the translation y to finish faster than the rest of the animation.
    // We want the translation y to finish faster than the rest of the animation.
    public static final float QUICK_SCRUB_TRANSLATION_Y_FACTOR = 5f / 6;
    public static final float QUICK_SCRUB_TRANSLATION_Y_FACTOR = 5f / 6;
    public static final Interpolator QUICK_SCRUB_START_INTERPOLATOR = FAST_OUT_SLOW_IN;
    public static final Interpolator QUICK_SCRUB_START_INTERPOLATOR = FAST_OUT_SLOW_IN;
@@ -145,6 +145,10 @@ public class QuickScrubController implements OnAlarmListener {
        return true;
        return true;
    }
    }


    public boolean isWaitingForTaskLaunch() {
        return mWaitingForTaskLaunch;
    }

    /**
    /**
     * Attempts to go to normal overview or back to home, so UI doesn't prevent user interaction.
     * Attempts to go to normal overview or back to home, so UI doesn't prevent user interaction.
     */
     */