diff options
author | Patrick Dubroy <dubroy@google.com> | 2011-03-02 15:28:44 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-02 15:28:44 -0800 |
commit | da6823e42ff8c9a0795203541a1cc55008ccad5a (patch) | |
tree | 599b4b6dc81566c77b67f409622665a3a4a6d032 /src/com | |
parent | 2763be3150d429d338b9848286e9365b4052c100 (diff) | |
parent | ba1ca8cf7ae52f730de9a8d543f8f0d484e76c32 (diff) | |
download | android_packages_apps_Trebuchet-da6823e42ff8c9a0795203541a1cc55008ccad5a.tar.gz android_packages_apps_Trebuchet-da6823e42ff8c9a0795203541a1cc55008ccad5a.tar.bz2 android_packages_apps_Trebuchet-da6823e42ff8c9a0795203541a1cc55008ccad5a.zip |
Merge "Fix 3377113: Mini homescreen outline wrong color"
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher2/DragController.java | 16 | ||||
-rw-r--r-- | src/com/android/launcher2/DragScroller.java | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index e54669718..331ebd635 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) { diff --git a/src/com/android/launcher2/DragScroller.java b/src/com/android/launcher2/DragScroller.java index 6af9c3032..6ef4bd873 100644 --- a/src/com/android/launcher2/DragScroller.java +++ b/src/com/android/launcher2/DragScroller.java @@ -26,6 +26,7 @@ public interface DragScroller { /** * The touch point has entered the scroll area; a scroll is imminent. + * This event will only occur while a drag is active. * * @param direction The scroll direction */ @@ -33,6 +34,7 @@ public interface DragScroller { /** * The touch point has left the scroll area. + * NOTE: This may not be called, if a drop occurs inside the scroll area. */ void onExitScrollArea(); } |