diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index e0156660efbbc..7f61e7a335778 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -380,10 +380,9 @@ public class DividerView extends FrameLayout implements OnTouchListener, mMoving = true; } if (mMoving && mDockSide != WindowManager.DOCKED_INVALID) { - int position = calculatePosition(x, y); - SnapTarget snapTarget = mSnapAlgorithm.calculateSnapTarget(position, - 0 /* velocity */, false /* hardDismiss */); - resizeStack(calculatePosition(x, y), snapTarget.position, snapTarget); + SnapTarget snapTarget = mSnapAlgorithm.calculateSnapTarget( + mStartPosition, 0 /* velocity */, false /* hardDismiss */); + resizeStack(calculatePosition(x, y), mStartPosition, snapTarget); } break; case MotionEvent.ACTION_UP: @@ -393,6 +392,13 @@ public class DividerView extends FrameLayout implements OnTouchListener, x = (int) event.getRawX(); y = (int) event.getRawY(); + if (mMoving && mDockSide != WindowManager.DOCKED_INVALID) { + int position = calculatePosition(x, y); + SnapTarget snapTarget = mSnapAlgorithm.calculateSnapTarget(position, + 0 /* velocity */, false /* hardDismiss */); + resizeStack(calculatePosition(x, y), snapTarget.position, snapTarget); + } + mVelocityTracker.computeCurrentVelocity(1000); int position = calculatePosition(x, y); stopDragging(position, isHorizontalDivision() ? mVelocityTracker.getYVelocity()