summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/FolderIcon.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher2/FolderIcon.java')
-rw-r--r--src/com/android/launcher2/FolderIcon.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java
index 0013644..e692d20 100644
--- a/src/com/android/launcher2/FolderIcon.java
+++ b/src/com/android/launcher2/FolderIcon.java
@@ -29,7 +29,7 @@ import com.android.launcher.R;
/**
* An icon that can appear on in the workspace representing an {@link UserFolder}.
*/
-public class FolderIcon extends BubbleTextView implements DropTarget {
+public class FolderIcon extends DimmableBubbleTextView implements DropTarget {
private UserFolderInfo mInfo;
private Launcher mLauncher;
private Drawable mCloseIcon;
@@ -43,6 +43,10 @@ public class FolderIcon extends BubbleTextView implements DropTarget {
super(context);
}
+ public boolean isDropEnabled() {
+ return !((Workspace)getParent().getParent()).isSmall();
+ }
+
static FolderIcon fromXml(int resId, Launcher launcher, ViewGroup group,
UserFolderInfo folderInfo) {
@@ -71,11 +75,6 @@ public class FolderIcon extends BubbleTextView implements DropTarget {
&& item.container != mInfo.id;
}
- public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset,
- DragView dragView, Object dragInfo, Rect recycle) {
- return null;
- }
-
public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
DragView dragView, Object dragInfo) {
ShortcutInfo item;
@@ -91,7 +90,9 @@ public class FolderIcon extends BubbleTextView implements DropTarget {
public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
DragView dragView, Object dragInfo) {
- setCompoundDrawablesWithIntrinsicBounds(null, mOpenIcon, null, null);
+ if (acceptDrop(source, x, y, xOffset, yOffset, dragView, dragInfo)) {
+ setCompoundDrawablesWithIntrinsicBounds(null, mOpenIcon, null, null);
+ }
}
public void onDragOver(DragSource source, int x, int y, int xOffset, int yOffset,
@@ -102,4 +103,10 @@ public class FolderIcon extends BubbleTextView implements DropTarget {
DragView dragView, Object dragInfo) {
setCompoundDrawablesWithIntrinsicBounds(null, mCloseIcon, null, null);
}
+
+ @Override
+ public DropTarget getDropTargetDelegate(DragSource source, int x, int y, int xOffset, int yOffset,
+ DragView dragView, Object dragInfo) {
+ return null;
+ }
}