Fixing issue where the outline is on the wrong side of the screen when dragging to final page.

- Also allowing pages to snap in springloaded mode without moving your finger.

Change-Id: I868f700bd740f2cd1e02023e1dee0f66b0799c58
This commit is contained in:
Winson Chung
2012-01-20 13:59:18 -08:00
parent 9b9a7588a2
commit 3bc21c35fa
3 changed files with 29 additions and 7 deletions
@@ -525,6 +525,12 @@ public class DragController {
}
}
public void forceMoveEvent() {
if (mDragging) {
handleMoveEvent(mDragObject.x, mDragObject.y);
}
}
/**
* Call this from a drag source view.
*/
@@ -558,12 +564,14 @@ public class DragController {
// Ensure that we've processed a move event at the current pointer location.
handleMoveEvent(dragLayerX, dragLayerY);
mHandler.removeCallbacks(mScrollRunnable);
if (mDragging) {
drop(dragLayerX, dragLayerY);
}
endDrag();
break;
case MotionEvent.ACTION_CANCEL:
mHandler.removeCallbacks(mScrollRunnable);
cancelDrag();
break;
}
@@ -690,7 +698,7 @@ public class DragController {
if (isDragging()) {
// Force an update so that we can requeue the scroller if necessary
handleMoveEvent(mDragObject.x, mDragObject.y);
forceMoveEvent();
}
}
}