HACK: Getting rid of all apps button / all apps from AppsCustomizePagedView

Change-Id: I74e4a53e9486237ad246ebdfa9e97c6ed9475b58
This commit is contained in:
Adam Cohen
2013-06-06 22:43:33 -07:00
parent b5fe60c8a5
commit 947dc54319
5 changed files with 38 additions and 58 deletions

View File

@@ -129,7 +129,12 @@ public class DeleteDropTarget extends ButtonDropTarget {
@Override
public boolean acceptDrop(DragObject d) {
// We can remove everything including App shortcuts, folders, widgets, etc.
return true;
if ((d.dragInfo instanceof LauncherAppWidgetInfo) ||
(d.dragInfo instanceof PendingAddWidgetInfo)) {
return true;
} else {
return false;
}
}
@Override
@@ -144,13 +149,12 @@ 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 (isAllAppsApplication(source, info)) {
ApplicationInfo appInfo = (ApplicationInfo) info;
if ((appInfo.flags & ApplicationInfo.DOWNLOADED_FLAG) != 0) {
isUninstall = true;
} else {
isVisible = false;
}
if ((info instanceof LauncherAppWidgetInfo) ||
(info instanceof PendingAddWidgetInfo)) {
isVisible = true;
} else {
isVisible = false;
}
if (isUninstall) {