Merge "Cancel fling animation when starting to drag" into nyc-dev

am: f0c548645f

* commit 'f0c548645fde12d26f379610e046d3b800fad38d':
  Cancel fling animation when starting to drag
This commit is contained in:
Jorim Jaggi
2016-02-20 02:32:32 +00:00
committed by android-build-merger

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;