Merge "Framework drag driver now sends new event type - exited window." into ub-launcher3-master
diff --git a/src/com/android/launcher3/DragController.java b/src/com/android/launcher3/DragController.java
index 2b4f019..1373bf2 100644
--- a/src/com/android/launcher3/DragController.java
+++ b/src/com/android/launcher3/DragController.java
@@ -437,6 +437,14 @@
}
@Override
+ public void onDriverDragExitWindow() {
+ if (mLastDropTarget != null) {
+ mLastDropTarget.onDragExit(mDragObject);
+ mLastDropTarget = null;
+ }
+ }
+
+ @Override
public void onDriverDragEnd(float x, float y, DropTarget dropTargetOverride) {
final int[] dragLayerPos = getClampedDragLayerPos(x, y);
final int dragLayerX = dragLayerPos[0];
diff --git a/src/com/android/launcher3/DragDriver.java b/src/com/android/launcher3/DragDriver.java
index 6cd52bd..9ee4b3d 100644
--- a/src/com/android/launcher3/DragDriver.java
+++ b/src/com/android/launcher3/DragDriver.java
@@ -32,6 +32,7 @@
public interface EventListener {
void onDriverDragMove(float x, float y);
+ void onDriverDragExitWindow();
void onDriverDragEnd(float x, float y, DropTarget dropTargetOverride);
void onDriverDragCancel();
}
@@ -165,6 +166,7 @@
return true;
case DragEvent.ACTION_DRAG_EXITED:
+ mEventListener.onDriverDragExitWindow();
return true;
case DragEvent.ACTION_DRAG_ENDED: