diff options
author | Patrick Dubroy <dubroy@google.com> | 2011-03-02 15:06:36 -0800 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2011-03-02 15:06:36 -0800 |
commit | ba1ca8cf7ae52f730de9a8d543f8f0d484e76c32 (patch) | |
tree | 59b1a74d53f2afde3a0876614b975a1c546d087a /src/com/android/launcher2/DragController.java | |
parent | fecd3b8e36dc0b785271b7a501ed174247c412a4 (diff) | |
download | packages_apps_trebuchet-ba1ca8cf7ae52f730de9a8d543f8f0d484e76c32.zip packages_apps_trebuchet-ba1ca8cf7ae52f730de9a8d543f8f0d484e76c32.tar.gz packages_apps_trebuchet-ba1ca8cf7ae52f730de9a8d543f8f0d484e76c32.tar.bz2 |
Fix 3377113: Mini homescreen outline wrong color
Couldn't repro this reliably, but the only way I could see
it happening is if we got an UP event without a MOVE at the
same location. This patch prevents that from happening.
Change-Id: I473c4ea50474b45da8c5537efe39177c1423ae20
Diffstat (limited to 'src/com/android/launcher2/DragController.java')
-rw-r--r-- | src/com/android/launcher2/DragController.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index e546697..331ebd6 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -557,6 +557,9 @@ public class DragController { handleMoveEvent(screenX, screenY); break; case MotionEvent.ACTION_UP: + // Ensure that we've processed a move event at the current pointer location. + handleMoveEvent(screenX, screenY); + mHandler.removeCallbacks(mScrollRunnable); if (mDragging) { drop(screenX, screenY); @@ -571,10 +574,11 @@ public class DragController { return true; } - private boolean drop(float x, float y) { + private void drop(float x, float y) { final int[] coordinates = mCoordinatesTemp; DropTarget dropTarget = findDropTarget((int) x, (int) y, coordinates); + boolean accepted = false; if (dropTarget != null) { dropTarget.onDragExit(mDragSource, coordinates[0], coordinates[1], (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo); @@ -582,16 +586,10 @@ public class DragController { (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo)) { dropTarget.onDrop(mDragSource, coordinates[0], coordinates[1], (int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo); - mDragSource.onDropCompleted((View) dropTarget, mDragInfo, true); - return true; - } else { - mDragSource.onDropCompleted((View) dropTarget, mDragInfo, false); - return true; + accepted = true; } - } else { - mDragSource.onDropCompleted(null, mDragInfo, false); } - return false; + mDragSource.onDropCompleted(null, mDragInfo, accepted); } private DropTarget findDropTarget(int x, int y, int[] dropCoordinates) { |