HACK: Getting rid of all apps button / all apps from AppsCustomizePagedView
Change-Id: I74e4a53e9486237ad246ebdfa9e97c6ed9475b58
diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java
index eba1547..d4e17b4 100644
--- a/src/com/android/launcher3/DeleteDropTarget.java
+++ b/src/com/android/launcher3/DeleteDropTarget.java
@@ -129,7 +129,12 @@
@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 @@
// 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) {