diff options
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 4d802bdb3..12c087f27 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -45,6 +45,7 @@ import android.content.SharedPreferences; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; +import android.content.pm.ResolveInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; @@ -4509,6 +4510,25 @@ public class Launcher extends Activity DISMISS_CLING_DURATION, true); } + public ItemInfo createAppDragInfo(Intent appLaunchIntent) { + ResolveInfo ri = getPackageManager().resolveActivity(appLaunchIntent, 0); + if (ri == null) { + return null; + } + return new AppInfo(getPackageManager(), ri, mIconCache, null); + } + + public ItemInfo createShortcutDragInfo(Intent shortcutIntent, CharSequence caption, + Bitmap icon) { + return new ShortcutInfo(shortcutIntent, caption, icon); + } + + public void startDrag(View dragView, ItemInfo dragInfo, DragSource source) { + dragView.setTag(dragInfo); + mWorkspace.onDragStartedWithItem(dragView); + mWorkspace.beginDragShared(dragView, source); + } + /** * Prints out out state for debugging. */ |