Merge "Fix bug where taskbar jumps when double swiping up." into tm-qpr-dev am: 9e593747e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22184665
Change-Id: Iceabe18b795d9e4bc63989532e351aaec0a7f38b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
index dd88a37..b9b63db 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarTranslationController.java
@@ -76,12 +76,11 @@
/**
* Called to cancel any existing animations.
*/
- public void cancelAnimationIfExists() {
+ public void cancelSpringIfExists() {
if (mSpringBounce != null) {
mSpringBounce.cancel();
mSpringBounce = null;
}
- reset();
}
private void updateTranslationYForSwipe() {
@@ -144,7 +143,8 @@
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
- cancelAnimationIfExists();
+ cancelSpringIfExists();
+ reset();
mAnimationToHomeRunning = true;
}
@@ -163,6 +163,18 @@
public class TransitionCallback {
/**
+ * Clears any existing animations so that user
+ * can take control over the movement of the taskbaer.
+ */
+ public void onActionDown() {
+ if (mAnimationToHomeRunning) {
+ mTranslationYForSwipe.cancelAnimation();
+ }
+ mAnimationToHomeRunning = false;
+ cancelSpringIfExists();
+ reset();
+ }
+ /**
* Called when there is movement to move the taskbar.
*/
public void onActionMove(float dY) {
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
index 1ddb855..a01d634 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
@@ -126,6 +126,10 @@
mCanceledUnstashHint = false;
}
}
+
+ if (mTransitionCallback != null && !mIsTaskbarAllAppsOpen) {
+ mTransitionCallback.onActionDown();
+ }
break;
case MotionEvent.ACTION_POINTER_UP:
int ptrIdx = ev.getActionIndex();