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

Commit ba4fcb01 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix bug where unstash animation plays twice." into udc-dev

parents ab9e66c2 e30a551f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.launcher3.taskbar;

import static com.android.launcher3.anim.AnimatedFloat.VALUE;

import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;

import androidx.annotation.Nullable;
@@ -85,6 +86,15 @@ public class TaskbarSpringOnStashController implements LoggableTaskbarController
                .build(mTranslationForStash, VALUE);
    }

    /**
     * Returns an animation to reset the stash translation back to 0 when unstashing.
     */
    public @Nullable ObjectAnimator createResetAnimForUnstash() {
        if (!mIsTransientTaskbar) {
            return null;
        }
        return mTranslationForStash.animateToValue(0);
    }

    @Override
    public void dumpLogs(String prefix, PrintWriter pw) {
+12 −0
Original line number Diff line number Diff line
@@ -799,6 +799,9 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
        if (isStashed) {
            play(skippable, mControllers.taskbarSpringOnStashController.createSpringToStash(),
                    0, duration, LINEAR);
        } else {
            play(skippable, mControllers.taskbarSpringOnStashController.createResetAnimForUnstash(),
                    0, duration, LINEAR);
        }

        mControllers.taskbarViewController.addRevealAnimToIsStashed(skippable, isStashed, duration,
@@ -1218,6 +1221,15 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba
                    && mLastStartedTransitionType == TRANSITION_DEFAULT
                    && animationType != TRANSITION_DEFAULT;

            // It is possible for stash=false to be requested by TRANSITION_HOME_TO_APP and
            // TRANSITION_DEFAULT in quick succession. In this case, we should ignore
            // transitionTypeChanged because the animations are exactly the same.
            if (transitionTypeChanged
                    && (!mIsStashed && !isStashed)
                    && animationType == TRANSITION_HOME_TO_APP) {
                transitionTypeChanged = false;
            }

            if (mIsStashed != isStashed || transitionTypeChanged) {
                mIsStashed = isStashed;
                mLastStartedTransitionType = animationType;