summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher/FolderIcon.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2009-04-07 21:08:40 -0700
committerJeff Sharkey <jsharkey@android.com>2009-04-08 16:44:27 -0700
commit70864289fba6daf07b8de98524cdfb765a62552d (patch)
tree5660819a8b529322c9c175c54f77be12b070a548 /src/com/android/launcher/FolderIcon.java
parentbb760cc21e6e66306a7524ed79454c676a491702 (diff)
downloadandroid_packages_apps_Trebuchet-70864289fba6daf07b8de98524cdfb765a62552d.tar.gz
android_packages_apps_Trebuchet-70864289fba6daf07b8de98524cdfb765a62552d.tar.bz2
android_packages_apps_Trebuchet-70864289fba6daf07b8de98524cdfb765a62552d.zip
Make Launcher more forgiving when dragging desktop items.
This change adds nearby-area searching when dragging desktop items into already-occupied cells. This approach tries harder to find a matching area, instead of strictly rejecting invalid moves. We also draw a "snag" during the drag to show where an item would be dropped, but only if we would drop into an alternative cell. This gives users better feedback about where things will drop. http://b/issue?id=1634887
Diffstat (limited to 'src/com/android/launcher/FolderIcon.java')
-rw-r--r--src/com/android/launcher/FolderIcon.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/launcher/FolderIcon.java b/src/com/android/launcher/FolderIcon.java
index 667f92ee1..a56101d51 100644
--- a/src/com/android/launcher/FolderIcon.java
+++ b/src/com/android/launcher/FolderIcon.java
@@ -18,6 +18,7 @@ package com.android.launcher;
import android.content.Context;
import android.content.res.Resources;
+import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
@@ -69,6 +70,10 @@ public class FolderIcon extends BubbleTextView implements DropTarget {
&& item.container != mInfo.id;
}
+ public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo, Rect recycle) {
+ return null;
+ }
+
public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, Object dragInfo) {
final ApplicationInfo item = (ApplicationInfo) dragInfo;
// TODO: update open folder that is looking at this data