Merge "Set snapTargetBeforeMinimized to middle target if position is negative" into pi-dev am: 5e86c3c28d

am: 3b4ea4aef0

Change-Id: I6e6c4096f051f32f41d6f2065506012f941c5bda
This commit is contained in:
Chavi Weingarten
2018-03-28 17:19:50 +00:00
committed by android-build-merger

View File

@@ -592,7 +592,16 @@ public class DividerView extends FrameLayout implements OnTouchListener,
// Record last snap target the divider moved to
if (mHomeStackResizable && !mIsInMinimizeInteraction) {
saveSnapTargetBeforeMinimized(snapTarget);
// The last snapTarget position can be negative when the last divider position was
// offscreen. In that case, save the middle (default) SnapTarget so calculating next
// position isn't negative.
final SnapTarget saveTarget;
if (snapTarget.position < 0) {
saveTarget = mSnapAlgorithm.getMiddleTarget();
} else {
saveTarget = snapTarget;
}
saveSnapTargetBeforeMinimized(saveTarget);
}
};
Runnable notCancelledEndAction = () -> {