Allow fling gesture while dragging from AllApps to dismiss drag.

Change-Id: I5eea14336579a1374aded63dda9ad1a33e8b8d4a
This commit is contained in:
Winson Chung
2012-03-20 16:19:37 -07:00
parent 6f8cb5201d
commit a48487a814
6 changed files with 99 additions and 27 deletions
@@ -366,7 +366,7 @@ public class DragController {
mDragObject.deferDragViewCleanupPostAnimation = false;
mDragObject.cancelled = true;
mDragObject.dragComplete = true;
mDragObject.dragSource.onDropCompleted(null, mDragObject, false);
mDragObject.dragSource.onDropCompleted(null, mDragObject, false, false);
}
endDrag();
}
@@ -422,6 +422,10 @@ public class DragController {
}
}
void onDeferredEndFling(DropTarget.DragObject d) {
d.dragSource.onFlingToDeleteCompleted();
}
/**
* Clamps the position to the drag layer bounds.
*/
@@ -665,7 +669,7 @@ public class DragController {
vel);
accepted = true;
}
mDragObject.dragSource.onDropCompleted((View) mFlingToDeleteDropTarget, mDragObject,
mDragObject.dragSource.onDropCompleted((View) mFlingToDeleteDropTarget, mDragObject, true,
accepted);
}
@@ -684,7 +688,7 @@ public class DragController {
accepted = true;
}
}
mDragObject.dragSource.onDropCompleted((View) dropTarget, mDragObject, accepted);
mDragObject.dragSource.onDropCompleted((View) dropTarget, mDragObject, false, accepted);
}
private DropTarget findDropTarget(int x, int y, int[] dropCoordinates) {