Cancel fling animation when starting to drag

Makes sure we don't end up in a weird state because
at the end of the fling animation, mDockSide gets
reset.

Bug: 27269044
Change-Id: I779b8ee9be9a35553c7f822421d1f02ca802111c
This commit is contained in:
Jorim Jaggi
2016-02-19 16:38:49 -08:00
parent 9d3a4e1c31
commit 0c790411c3

View File

@@ -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;