summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher2/DragController.java16
-rw-r--r--src/com/android/launcher2/DragScroller.java2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index 331ebd635..e54669718 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -557,9 +557,6 @@ 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);
@@ -574,11 +571,10 @@ public class DragController {
return true;
}
- private void drop(float x, float y) {
+ private boolean 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);
@@ -586,10 +582,16 @@ public class DragController {
(int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo)) {
dropTarget.onDrop(mDragSource, coordinates[0], coordinates[1],
(int) mTouchOffsetX, (int) mTouchOffsetY, mDragView, mDragInfo);
- accepted = true;
+ mDragSource.onDropCompleted((View) dropTarget, mDragInfo, true);
+ return true;
+ } else {
+ mDragSource.onDropCompleted((View) dropTarget, mDragInfo, false);
+ return true;
}
+ } else {
+ mDragSource.onDropCompleted(null, mDragInfo, false);
}
- mDragSource.onDropCompleted(null, mDragInfo, accepted);
+ return false;
}
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 6ef4bd873..6af9c3032 100644
--- a/src/com/android/launcher2/DragScroller.java
+++ b/src/com/android/launcher2/DragScroller.java
@@ -26,7 +26,6 @@ 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
*/
@@ -34,7 +33,6 @@ 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();
}