summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeleteDropTarget.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-04-22 11:29:51 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-04-24 10:47:56 -0700
commit1a70cef9884270f2f0a760f079a10fdfb1544c98 (patch)
tree1bd7b7fbacc5ed576c70ed4e62e379fca296b522 /src/com/android/launcher3/DeleteDropTarget.java
parentad4ba81384a08ec3ac6149b3a8c73e23d122026f (diff)
downloadandroid_packages_apps_Trebuchet-1a70cef9884270f2f0a760f079a10fdfb1544c98.tar.gz
android_packages_apps_Trebuchet-1a70cef9884270f2f0a760f079a10fdfb1544c98.tar.bz2
android_packages_apps_Trebuchet-1a70cef9884270f2f0a760f079a10fdfb1544c98.zip
Accessibility fixes
> Enabling top bar buttons in accessibility drag-drop > Unifying logic to show delete/uninstall/app-info targets > Announcing cell loction as 1-index instead of 0-index Change-Id: Ibc7801f77e938b2646f0655462cbe9b7f781818b
Diffstat (limited to 'src/com/android/launcher3/DeleteDropTarget.java')
-rw-r--r--src/com/android/launcher3/DeleteDropTarget.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java
index aa3e66c09..e741b9787 100644
--- a/src/com/android/launcher3/DeleteDropTarget.java
+++ b/src/com/android/launcher3/DeleteDropTarget.java
@@ -29,7 +29,6 @@ import android.view.ViewConfiguration;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
-import com.android.launcher3.R;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.widget.WidgetsContainerView;
@@ -59,13 +58,15 @@ public class DeleteDropTarget extends ButtonDropTarget {
setDrawable(R.drawable.remove_target_selector);
}
- public static boolean willAcceptDrop(DragSource source, Object info) {
- return (info instanceof ItemInfo) && source.supportsDeleteDropTarget();
+ public static boolean supportsDrop(Object info) {
+ return (info instanceof ShortcutInfo)
+ || (info instanceof LauncherAppWidgetInfo)
+ || (info instanceof FolderInfo);
}
@Override
protected boolean supportsDrop(DragSource source, Object info) {
- return willAcceptDrop(source, info);
+ return source.supportsDeleteDropTarget() && supportsDrop(info);
}
@Override
@@ -304,4 +305,9 @@ public class DeleteDropTarget extends ButtonDropTarget {
dragLayer.animateView(d.dragView, updateCb, duration, tInterpolator, onAnimationEndRunnable,
DragLayer.ANIMATION_END_DISAPPEAR, null);
}
+
+ @Override
+ protected String getAccessibilityDropConfirmation() {
+ return getResources().getString(R.string.item_removed);
+ }
}