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
This commit is contained in:
Sunny Goyal committed 2016-08-12 11:10:12 -07:00
1 parent eea721266f
commit 5836bf728e
3 files changed
+46 -37

No files matched your search

@@ -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() {