Fix bug where unstash animation plays twice.

Fixes: 282056846
Change-Id: I372444684fafd246369f6bc1e77c5e6fbb651c6f
Flag: ENABLE_TRANSIENT_TASKBAR
Test: open app, then very quickly swipe to unstash taskbar
This commit is contained in:
Jon Miranda
2023-05-11 17:01:33 -07:00
parent 52d4764576
commit e30a551f93
2 changed files with 22 additions and 0 deletions

View File

@@ -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) {