HACK: Fixing major persistence regression associated with extra screen to the left

-> Also adding ability to delete shortcuts.

Change-Id: I263baf813eae9089f11288494d575a99f0e859c3
This commit is contained in:
Adam Cohen
2013-06-14 17:42:35 -07:00
parent a0b5749433
commit 7c4c510829
4 changed files with 35 additions and 20 deletions

View File

@@ -128,13 +128,18 @@ public class DeleteDropTarget extends ButtonDropTarget {
@Override
public boolean acceptDrop(DragObject d) {
// We can remove everything including App shortcuts, folders, widgets, etc.
if ((d.dragInfo instanceof LauncherAppWidgetInfo) ||
(d.dragInfo instanceof PendingAddWidgetInfo)) {
return true;
} else {
return false;
return willAcceptDrop(d.dragInfo);
}
public static boolean willAcceptDrop(Object info) {
if (info instanceof ItemInfo) {
ItemInfo item = (ItemInfo) info;
if (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET ||
item.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
return true;
}
}
return false;
}
@Override
@@ -149,9 +154,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
// If we are dragging an application from AppsCustomize, only show the control if we can
// delete the app (it was downloaded), and rename the string to "uninstall" in such a case
if ((info instanceof LauncherAppWidgetInfo) ||
(info instanceof PendingAddWidgetInfo)) {
if (willAcceptDrop(info)) {
isVisible = true;
} else {
isVisible = false;