Merge "Some divider handling fixes" into nyc-dev
This commit is contained in:
@@ -383,13 +383,6 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
|||||||
x = (int) event.getRawX();
|
x = (int) event.getRawX();
|
||||||
y = (int) event.getRawY();
|
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);
|
mVelocityTracker.computeCurrentVelocity(1000);
|
||||||
int position = calculatePosition(x, y);
|
int position = calculatePosition(x, y);
|
||||||
stopDragging(position, isHorizontalDivision() ? mVelocityTracker.getYVelocity()
|
stopDragging(position, isHorizontalDivision() ? mVelocityTracker.getYVelocity()
|
||||||
@@ -734,21 +727,22 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
|||||||
mSnapAlgorithm.calculateDismissingFraction(position)));
|
mSnapAlgorithm.calculateDismissingFraction(position)));
|
||||||
SnapTarget dismissTarget = null;
|
SnapTarget dismissTarget = null;
|
||||||
SnapTarget splitTarget = null;
|
SnapTarget splitTarget = null;
|
||||||
if ((snapTarget.flag == SnapTarget.FLAG_DISMISS_START
|
int start = 0;
|
||||||
|| snapTarget == mSnapAlgorithm.getFirstSplitTarget())
|
if (position <= mSnapAlgorithm.getLastSplitTarget().position
|
||||||
&& dockSideTopLeft(dockSide)) {
|
&& dockSideTopLeft(dockSide)) {
|
||||||
dismissTarget = mSnapAlgorithm.getDismissStartTarget();
|
dismissTarget = mSnapAlgorithm.getDismissStartTarget();
|
||||||
splitTarget = mSnapAlgorithm.getFirstSplitTarget();
|
splitTarget = mSnapAlgorithm.getFirstSplitTarget();
|
||||||
} else if ((snapTarget.flag == SnapTarget.FLAG_DISMISS_END
|
start = taskPosition;
|
||||||
|| snapTarget == mSnapAlgorithm.getLastSplitTarget())
|
} else if (position >= mSnapAlgorithm.getLastSplitTarget().position
|
||||||
&& dockSideBottomRight(dockSide)) {
|
&& dockSideBottomRight(dockSide)) {
|
||||||
dismissTarget = mSnapAlgorithm.getDismissEndTarget();
|
dismissTarget = mSnapAlgorithm.getDismissEndTarget();
|
||||||
splitTarget = mSnapAlgorithm.getLastSplitTarget();
|
splitTarget = mSnapAlgorithm.getLastSplitTarget();
|
||||||
|
start = splitTarget.position;
|
||||||
}
|
}
|
||||||
if (dismissTarget != null && fraction > 0f
|
if (dismissTarget != null && fraction > 0f
|
||||||
&& isDismissing(splitTarget, position, dockSide)) {
|
&& isDismissing(splitTarget, position, dockSide)) {
|
||||||
fraction = calculateParallaxDismissingFraction(fraction, dockSide);
|
fraction = calculateParallaxDismissingFraction(fraction, dockSide);
|
||||||
int offsetPosition = (int) (taskPosition +
|
int offsetPosition = (int) (start +
|
||||||
fraction * (dismissTarget.position - splitTarget.position));
|
fraction * (dismissTarget.position - splitTarget.position));
|
||||||
int width = taskRect.width();
|
int width = taskRect.width();
|
||||||
int height = taskRect.height();
|
int height = taskRect.height();
|
||||||
@@ -796,11 +790,12 @@ public class DividerView extends FrameLayout implements OnTouchListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getStackIdForDismissTarget(SnapTarget dismissTarget) {
|
private int getStackIdForDismissTarget(SnapTarget dismissTarget) {
|
||||||
if (dismissTarget.flag == SnapTarget.FLAG_DISMISS_START &&
|
if ((dismissTarget.flag == SnapTarget.FLAG_DISMISS_START && dockSideTopLeft(mDockSide))
|
||||||
(mDockSide == WindowManager.DOCKED_LEFT || mDockSide == WindowManager.DOCKED_TOP)) {
|
|| (dismissTarget.flag == SnapTarget.FLAG_DISMISS_END
|
||||||
|
&& dockSideBottomRight(mDockSide))) {
|
||||||
return StackId.DOCKED_STACK_ID;
|
return StackId.DOCKED_STACK_ID;
|
||||||
} else {
|
} else {
|
||||||
return StackId.FULLSCREEN_WORKSPACE_STACK_ID;
|
return StackId.HOME_STACK_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user