diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-08-12 11:08:29 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-08-12 11:10:12 -0700 |
commit | 5836bf728e85c1c4fae67862deb4e973ac55e944 (patch) | |
tree | 8f0cd0fb47819a9947830a2047e03c4fb90b700e /src/com/android/launcher3/accessibility | |
parent | eea721266f0a7c2c60097cba8363cfca12de9e46 (diff) | |
download | android_packages_apps_Trebuchet-5836bf728e85c1c4fae67862deb4e973ac55e944.tar.gz android_packages_apps_Trebuchet-5836bf728e85c1c4fae67862deb4e973ac55e944.tar.bz2 android_packages_apps_Trebuchet-5836bf728e85c1c4fae67862deb4e973ac55e944.zip |
Moving the shortcut application logic to the DeepShortcutView.
This makes the logic for accessing various properties consistant and
and ties it to the UI of the DeepShortcutView.
Bug: 30817556
Change-Id: I09536b9f91b2a9969fcc286f83dd2b17e16cd9ce
Diffstat (limited to 'src/com/android/launcher3/accessibility')
-rw-r--r-- | src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java index ff70279ea..0baa8f3db 100644 --- a/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java +++ b/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java @@ -25,6 +25,7 @@ import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherSettings; import com.android.launcher3.R; import com.android.launcher3.ShortcutInfo; +import com.android.launcher3.shortcuts.DeepShortcutView; import java.util.ArrayList; @@ -46,7 +47,10 @@ public class ShortcutMenuAccessibilityDelegate extends LauncherAccessibilityDele @Override public boolean performAction(View host, ItemInfo item, int action) { if (action == ADD_TO_WORKSPACE) { - final ShortcutInfo info = (ShortcutInfo) item; + if (!(host.getParent() instanceof DeepShortcutView)) { + return false; + } + final ShortcutInfo info = ((DeepShortcutView) host.getParent()).getFinalInfo(); final int[] coordinates = new int[2]; final long screenId = findSpaceOnWorkspace(item, coordinates); Runnable onComplete = new Runnable() { |