From e01af631dc98fa3e97b01b4d3ac135cf7ca5917e Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 26 Sep 2013 10:43:20 -0700 Subject: [PATCH] Hiding delete for AppsCustomize widgets. (Bug 10884035) Change-Id: I8bb4e94b34a627fc32f42cd9c22480b8fa45a651 --- src/com/android/launcher3/DeleteDropTarget.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java index 56f595c744..da6f2f79bc 100644 --- a/src/com/android/launcher3/DeleteDropTarget.java +++ b/src/com/android/launcher3/DeleteDropTarget.java @@ -175,16 +175,10 @@ public class DeleteDropTarget extends ButtonDropTarget { boolean isVisible = true; boolean isUninstall = false; - // If we are dragging a widget from AppsCustomize, hide the delete target - if (isAllAppsWidget(source, info)) { - isVisible = false; - } - // 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 (willAcceptDrop(info)) { - isVisible = true; - } else { + // delete the app (it was downloaded), and rename the string to "uninstall" in such a case. + // Hide the delete target if it is a widget from AppsCustomize. + if (!willAcceptDrop(info) || isAllAppsWidget(source, info)) { isVisible = false; }