diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/DeleteDropTarget.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java b/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java index 858bbe15a..526139473 100644 --- a/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java +++ b/src/com/cyanogenmod/trebuchet/DeleteDropTarget.java @@ -97,6 +97,9 @@ public class DeleteDropTarget extends ButtonDropTarget { } } + private boolean isAllAppsItem(DragSource source, Object info) { + return isAllAppsApplication(source, info) || isAllAppsWidget(source, info); + } private boolean isAllAppsApplication(DragSource source, Object info) { return (source instanceof AppsCustomizePagedView) && (info instanceof ApplicationInfo); } @@ -171,7 +174,11 @@ public class DeleteDropTarget extends ButtonDropTarget { resetHoverColor(); ((ViewGroup) getParent()).setVisibility(View.VISIBLE); if (getText().length() > 0) { - setText(R.string.delete_target_label); + if (isAllAppsItem(source, info)) { + setText(R.string.cancel_target_label); + } else { + setText(R.string.delete_target_label); + } } } @@ -220,7 +227,11 @@ public class DeleteDropTarget extends ButtonDropTarget { mMode = MODE_DELETE; if (getText().length() > 0) { - setText(R.string.delete_target_label); + if (isAllAppsItem(d.dragSource, d.dragInfo)) { + setText(R.string.cancel_target_label); + } else { + setText(R.string.delete_target_label); + } } setCompoundDrawablesWithIntrinsicBounds(mRemoveNormalDrawable, null, null, null); |