summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/InfoDropTarget.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-01-08 16:59:04 -0800
committerSunny Goyal <sunnygoyal@google.com>2015-01-16 17:40:41 -0800
commit71b5c0b988a64b3a0613ded5403749bc537ee8a5 (patch)
treedec5e13b1ef53a7005a9776387fc0a4c1895c39c /src/com/android/launcher3/InfoDropTarget.java
parent08f7261d11a53ae4b330ad4fa897b8519de3d750 (diff)
downloadandroid_packages_apps_Trebuchet-71b5c0b988a64b3a0613ded5403749bc537ee8a5.tar.gz
android_packages_apps_Trebuchet-71b5c0b988a64b3a0613ded5403749bc537ee8a5.tar.bz2
android_packages_apps_Trebuchet-71b5c0b988a64b3a0613ded5403749bc537ee8a5.zip
Adding accessibility controls
> Adding 'Remove' option to workspace items > Adding 'Add to workspace' to all apps and widget list items, which adds the item to the first available space, giving preference to the current workspace screen > Adding 'App info' and 'Uninstall' options to appropriate items Bug: 18482913 Change-Id: Ifab7423af2d9ba502b5a2771b37bb5436b3df937
Diffstat (limited to 'src/com/android/launcher3/InfoDropTarget.java')
-rw-r--r--src/com/android/launcher3/InfoDropTarget.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/com/android/launcher3/InfoDropTarget.java b/src/com/android/launcher3/InfoDropTarget.java
index 7e55af228..3c36361aa 100644
--- a/src/com/android/launcher3/InfoDropTarget.java
+++ b/src/com/android/launcher3/InfoDropTarget.java
@@ -76,28 +76,32 @@ public class InfoDropTarget extends ButtonDropTarget {
// acceptDrop is called just before onDrop. We do the work here, rather than
// in onDrop, because it allows us to reject the drop (by returning false)
// so that the object being dragged isn't removed from the drag source.
+
+ startDetailsActivityForInfo(d.dragInfo, mLauncher);
+ // There is no post-drop animation, so clean up the DragView now
+ d.deferDragViewCleanupPostAnimation = false;
+ return false;
+ }
+
+ public static void startDetailsActivityForInfo(Object info, Launcher launcher) {
ComponentName componentName = null;
- if (d.dragInfo instanceof AppInfo) {
- componentName = ((AppInfo) d.dragInfo).componentName;
- } else if (d.dragInfo instanceof ShortcutInfo) {
- componentName = ((ShortcutInfo) d.dragInfo).intent.getComponent();
- } else if (d.dragInfo instanceof PendingAddItemInfo) {
- componentName = ((PendingAddItemInfo) d.dragInfo).componentName;
+ if (info instanceof AppInfo) {
+ componentName = ((AppInfo) info).componentName;
+ } else if (info instanceof ShortcutInfo) {
+ componentName = ((ShortcutInfo) info).intent.getComponent();
+ } else if (info instanceof PendingAddItemInfo) {
+ componentName = ((PendingAddItemInfo) info).componentName;
}
final UserHandleCompat user;
- if (d.dragInfo instanceof ItemInfo) {
- user = ((ItemInfo) d.dragInfo).user;
+ if (info instanceof ItemInfo) {
+ user = ((ItemInfo) info).user;
} else {
user = UserHandleCompat.myUserHandle();
}
if (componentName != null) {
- mLauncher.startApplicationDetailsActivity(componentName, user);
+ launcher.startApplicationDetailsActivity(componentName, user);
}
-
- // There is no post-drop animation, so clean up the DragView now
- d.deferDragViewCleanupPostAnimation = false;
- return false;
}
@Override