From 27ab9d96ebe8626bc2e77f2525e424d260884354 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 28 Jul 2021 08:03:14 -1000 Subject: [PATCH] Let TaskbarDragView scale up before switching to system drag view Test: Long press taskbar icons, ensure they aniamte the scale up Fixes: 182981908 Change-Id: I573fe66c93ebf995b3f56f2c003dee987687b6a7 --- .../taskbar/TaskbarDragController.java | 19 +++++++++++++++++++ .../android/launcher3/dragndrop/DragView.java | 14 ++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java index 67ebc02a74..b89032e704 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java @@ -117,6 +117,24 @@ public class TaskbarDragController extends DragController extends Fram private boolean mHasDrawn = false; final ValueAnimator mAnim; + // Whether mAnim has started. Unlike mAnim.isStarted(), this is true even after mAnim ends. + private boolean mAnimStarted; private int mLastTouchX; private int mLastTouchY; @@ -171,6 +175,12 @@ public abstract class DragView extends Fram animation.cancel(); } }); + mAnim.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationStart(Animator animation) { + mAnimStarted = true; + } + }); setDragRegion(new Rect(0, 0, width, height)); @@ -396,6 +406,10 @@ public abstract class DragView extends Fram } } + public boolean isAnimationFinished() { + return mAnimStarted && !mAnim.isRunning(); + } + /** * Move the window containing this view. *