summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/DropTarget.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-08-04 16:04:30 -0400
committerJoe Onorato <joeo@android.com>2009-08-06 12:45:43 -0700
commit00acb123c5100f06b8e89e8ec8978ebafc6f6d26 (patch)
tree77c09f4bcd3174e687ce4d5f31a0f89a55e52bb8 /src/com/android/launcher2/DropTarget.java
parent17721426111214db82ea00abd8bfafc66e65fe71 (diff)
downloadandroid_packages_apps_Trebuchet-00acb123c5100f06b8e89e8ec8978ebafc6f6d26.tar.gz
android_packages_apps_Trebuchet-00acb123c5100f06b8e89e8ec8978ebafc6f6d26.tar.bz2
android_packages_apps_Trebuchet-00acb123c5100f06b8e89e8ec8978ebafc6f6d26.zip
Move the drag thing into its own window that goes around on top of everything else.
Diffstat (limited to 'src/com/android/launcher2/DropTarget.java')
-rw-r--r--src/com/android/launcher2/DropTarget.java33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/com/android/launcher2/DropTarget.java b/src/com/android/launcher2/DropTarget.java
index e092e5095..72eb33094 100644
--- a/src/com/android/launcher2/DropTarget.java
+++ b/src/com/android/launcher2/DropTarget.java
@@ -30,18 +30,25 @@ public interface DropTarget {
* @param source DragSource where the drag started
* @param x X coordinate of the drop location
* @param y Y coordinate of the drop location
- * @param xOffset Horizontal offset with the object being dragged where the original touch happened
- * @param yOffset Vertical offset with the object being dragged where the original touch happened
+ * @param xOffset Horizontal offset with the object being dragged where the original
+ * touch happened
+ * @param yOffset Vertical offset with the object being dragged where the original
+ * touch happened
+ * @param dragView The DragView that's being dragged around on screen.
* @param dragInfo Data associated with the object being dragged
*
*/
- void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
- void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
- void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
- void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
/**
* Check if a drop action can occur at, or near, the requested location.
@@ -55,10 +62,12 @@ public interface DropTarget {
* original touch happened
* @param yOffset Vertical offset with the object being dragged where the
* original touch happened
+ * @param dragView The DragView that's being dragged around on screen.
* @param dragInfo Data associated with the object being dragged
* @return True if the drop will be accepted, false otherwise.
*/
- boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo);
+ boolean acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo);
/**
* Estimate the surface area where this object would land if dropped at the
@@ -71,11 +80,19 @@ public interface DropTarget {
* original touch happened
* @param yOffset Vertical offset with the object being dragged where the
* original touch happened
+ * @param dragView The DragView that's being dragged around on screen.
* @param dragInfo Data associated with the object being dragged
* @param recycle {@link Rect} object to be possibly recycled.
* @return Estimated area that would be occupied if object was dropped at
* the given location. Should return null if no estimate is found,
* or if this target doesn't provide estimations.
*/
- Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo, Rect recycle);
+ Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo, Rect recycle);
+
+ // These methods are implemented in Views
+ void getHitRect(Rect outRect);
+ void getLocationOnScreen(int[] loc);
+ int getLeft();
+ int getTop();
}