Revert "Allow user gesture to take priority over taskbar translation reset animnatiuon."
This reverts commit 41b580bc63518716c4b9fa5878ae84d294cdc2b0.
Bug: 277942460
Test: tablet/foldable device
check taskbar animation b/w states and during drag
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c9a4c1ceaed8660d2ecaa87d7d2e2b48c7de7390)
Merged-In: Ib8b362102d08d155d3153b652db47364feb5df0a
Change-Id: Ib8b362102d08d155d3153b652db47364feb5df0a
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
index 58cb558..9bc8cdd 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java
@@ -642,7 +642,7 @@
long resetDuration = mControllers.taskbarStashController.isInApp()
? duration
: duration / 2;
- if (mControllers.taskbarTranslationController.shouldResetBackToZero(resetDuration)
+ if (!mControllers.taskbarTranslationController.willAnimateToZeroBefore(resetDuration)
&& (isAnimatingToLauncher() || mLauncherState == LauncherState.NORMAL)) {
animatorSet.play(mControllers.taskbarTranslationController
.createAnimToResetTranslation(resetDuration));
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
index 4b18bb6..065d111 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
@@ -54,7 +54,6 @@
private boolean mHasSprungOnceThisGesture;
private @Nullable ValueAnimator mSpringBounce;
private boolean mGestureEnded;
- private boolean mGestureInProgress;
private boolean mAnimationToHomeRunning;
private final boolean mIsTransientTaskbar;
@@ -124,7 +123,6 @@
private void reset() {
mGestureEnded = false;
- mGestureInProgress = false;
mHasSprungOnceThisGesture = false;
}
@@ -136,24 +134,18 @@
}
/**
- * Returns {@code true} if we should reset the animation back to zero.
- *
- * Returns {@code false} if there is a gesture in progress, or if we are already animating
- * to 0 within the specified duration.
+ * Returns true if we will animate to zero before the input duration.
*/
- public boolean shouldResetBackToZero(long duration) {
- if (mGestureInProgress) {
- return false;
- }
+ public boolean willAnimateToZeroBefore(long duration) {
if (mSpringBounce != null && mSpringBounce.isRunning()) {
long springDuration = mSpringBounce.getDuration();
long current = mSpringBounce.getCurrentPlayTime();
- return (springDuration - current >= duration);
+ return (springDuration - current < duration);
}
if (mTranslationYForSwipe.isAnimatingToValue(0)) {
- return mTranslationYForSwipe.getRemainingTime() >= duration;
+ return mTranslationYForSwipe.getRemainingTime() < duration;
}
- return true;
+ return false;
}
/**
@@ -196,7 +188,6 @@
mAnimationToHomeRunning = false;
cancelSpringIfExists();
reset();
- mGestureInProgress = true;
}
/**
* Called when there is movement to move the taskbar.
@@ -220,7 +211,6 @@
mGestureEnded = true;
startSpring();
}
- mGestureInProgress = false;
}
}
@@ -232,7 +222,6 @@
pw.println(prefix + "\tmHasSprungOnceThisGesture=" + mHasSprungOnceThisGesture);
pw.println(prefix + "\tmAnimationToHomeRunning=" + mAnimationToHomeRunning);
pw.println(prefix + "\tmGestureEnded=" + mGestureEnded);
- pw.println(prefix + "\tmGestureInProgress=" + mGestureInProgress);
pw.println(prefix + "\tmSpringBounce is running=" + (mSpringBounce != null
&& mSpringBounce.isRunning()));
}