diff options
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher3/Folder.java | 9 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/WidgetAdder.java | 7 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java index 347a1d428..121480627 100644 --- a/src/com/android/launcher3/Folder.java +++ b/src/com/android/launcher3/Folder.java @@ -236,14 +236,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList public void onClick(View v) { Object tag = v.getTag(); if (tag instanceof ShortcutInfo) { - // refactor this code from Folder - ShortcutInfo item = (ShortcutInfo) tag; - int[] pos = new int[2]; - v.getLocationOnScreen(pos); - item.intent.setSourceBounds(new Rect(pos[0], pos[1], - pos[0] + v.getWidth(), pos[1] + v.getHeight())); - - mLauncher.startActivitySafely(v, item.intent, item); + mLauncher.onClick(v); } } diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index a5a90d2c5..664b76323 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2000,6 +2000,12 @@ public final class Launcher extends Activity if (tag instanceof ShortcutInfo) { // Open shortcut final Intent intent = ((ShortcutInfo) tag).intent; + + ComponentName widgetComp = new ComponentName(this, WidgetAdder.class); + if (intent.getComponent().getClassName().equals(widgetComp.getClassName())) { + showAllApps(true); + return; + } int[] pos = new int[2]; v.getLocationOnScreen(pos); intent.setSourceBounds(new Rect(pos[0], pos[1], diff --git a/src/com/android/launcher3/WidgetAdder.java b/src/com/android/launcher3/WidgetAdder.java new file mode 100644 index 000000000..79ac50492 --- /dev/null +++ b/src/com/android/launcher3/WidgetAdder.java @@ -0,0 +1,7 @@ +package com.android.launcher3; + +import android.app.Activity; + +public class WidgetAdder extends Activity { + +} |