diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index 9fc2846ba0ffb..65a2f8fc8f064 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -40,7 +40,6 @@ import android.view.ViewTreeObserver.InternalInsetsInfo; import android.view.ViewTreeObserver.OnComputeInternalInsetsListener; import android.view.WindowInsets; import android.view.WindowManager; -import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; import android.widget.FrameLayout; @@ -131,6 +130,7 @@ public class DividerView extends FrameLayout implements OnTouchListener, private boolean mAnimateAfterRecentsDrawn; private boolean mGrowAfterRecentsDrawn; private boolean mGrowRecents; + private Animator mCurrentAnimator; public DividerView(Context context) { super(context); @@ -210,6 +210,7 @@ public class DividerView extends FrameLayout implements OnTouchListener, } public boolean startDragging(boolean animate, boolean touching) { + cancelFlingAnimation(); if (touching) { mHandle.setTouching(true, animate); } @@ -369,11 +370,19 @@ public class DividerView extends FrameLayout implements OnTouchListener, commitSnapFlags(snapTarget); mWindowManagerProxy.setResizing(false); mDockSide = WindowManager.DOCKED_INVALID; + mCurrentAnimator = null; } }); + mCurrentAnimator = anim; return anim; } + private void cancelFlingAnimation() { + if (mCurrentAnimator != null) { + mCurrentAnimator.cancel(); + } + } + private void commitSnapFlags(SnapTarget target) { if (target.flag == SnapTarget.FLAG_NONE) { return;