mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user