Only resize task when divider is released
To reduced jank during resizing we now only resize the task when the split-screen divider is release vs always resizing it to the snap points. Bug: 27738239 Bug: 27676101 Bug: 27601572 Change-Id: Iad450842d82193bc1731729834339068cf2d3e83
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user