diff options
author | Winson Chung <winsonc@google.com> | 2011-01-04 16:03:57 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-01-04 16:04:32 -0800 |
commit | 621e6406fadba27d6cff1c38b31d5cdf99c0f97a (patch) | |
tree | 34bff3d889414d85a0b9236fda5c3e806450a0e3 /src/com/android/launcher2/DragController.java | |
parent | c1ef5c33d96b1dbcf1825f8a1e52d3b974f9e8c2 (diff) | |
download | packages_apps_trebuchet-621e6406fadba27d6cff1c38b31d5cdf99c0f97a.zip packages_apps_trebuchet-621e6406fadba27d6cff1c38b31d5cdf99c0f97a.tar.gz packages_apps_trebuchet-621e6406fadba27d6cff1c38b31d5cdf99c0f97a.tar.bz2 |
Cancelling a drag should signal to the source that the drag is incomplete.
Change-Id: I6464c4ccf15b550dd319e18c2e998131e46ccc0f
Diffstat (limited to 'src/com/android/launcher2/DragController.java')
-rw-r--r-- | src/com/android/launcher2/DragController.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index 876ad87..0f24cd9 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -394,6 +394,9 @@ public class DragController { * Stop dragging without dropping. */ public void cancelDrag() { + if (mDragging) { + mDragSource.onDropCompleted(null, false); + } endDrag(); } @@ -433,21 +436,21 @@ public class DragController { switch (action) { case MotionEvent.ACTION_MOVE: break; - case MotionEvent.ACTION_DOWN: // Remember location of down touch mMotionDownX = screenX; mMotionDownY = screenY; mLastDropTarget = null; break; - - case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: if (mDragging) { drop(screenX, screenY); } endDrag(); break; + case MotionEvent.ACTION_CANCEL: + cancelDrag(); + break; } return mDragging; @@ -568,10 +571,10 @@ public class DragController { drop(screenX, screenY); } endDrag(); - break; case MotionEvent.ACTION_CANCEL: cancelDrag(); + break; } return true; |