diff options
author | Patrick Dubroy <dubroy@google.com> | 2011-03-02 18:40:21 -0800 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2011-03-02 18:40:21 -0800 |
commit | b0a6bbeeab0960419dcd1f695c209ca0ec36ab8a (patch) | |
tree | a29fabdf6bd24a92a9ce304de84a0ca3e7f60c07 /src/com/android/launcher2/DragController.java | |
parent | bd361f7a854112ba8217213ac15131600726a90b (diff) | |
download | packages_apps_trebuchet-b0a6bbeeab0960419dcd1f695c209ca0ec36ab8a.zip packages_apps_trebuchet-b0a6bbeeab0960419dcd1f695c209ca0ec36ab8a.tar.gz packages_apps_trebuchet-b0a6bbeeab0960419dcd1f695c209ca0ec36ab8a.tar.bz2 |
*Actually* fix 3377113: Mini homescreen outline wrong color
New and improved! 100% fewer regressions!
Change-Id: I079a7842ecfe7e84c3fd599d6156638588a1d2d0
Diffstat (limited to 'src/com/android/launcher2/DragController.java')
-rw-r--r-- | src/com/android/launcher2/DragController.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index e546697..cb4509b 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); + final 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((View) dropTarget, mDragInfo, accepted); } private DropTarget findDropTarget(int x, int y, int[] dropCoordinates) { |