diff options
author | Winson Chung <winsonc@google.com> | 2011-01-04 16:32:20 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-04 16:32:20 -0800 |
commit | 34a75b4ecca6526bef1daf9f1f246ba64be44c42 (patch) | |
tree | be5d04ad85d4b94b3bb8e7e4f6ce2c96f9000f19 | |
parent | cadecd0867bdc6b70ab467cabf3d02ef973dad7b (diff) | |
parent | 621e6406fadba27d6cff1c38b31d5cdf99c0f97a (diff) | |
download | android_packages_apps_Trebuchet-34a75b4ecca6526bef1daf9f1f246ba64be44c42.tar.gz android_packages_apps_Trebuchet-34a75b4ecca6526bef1daf9f1f246ba64be44c42.tar.bz2 android_packages_apps_Trebuchet-34a75b4ecca6526bef1daf9f1f246ba64be44c42.zip |
Merge "Cancelling a drag should signal to the source that the drag is incomplete."
-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 876ad8797..0f24cd9e2 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; |