diff options
author | Joe Onorato <joeo@android.com> | 2009-10-06 12:34:42 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-10-06 12:34:42 -0700 |
commit | 2e5c432a0aa7e83031575df73bed43a297e2eed3 (patch) | |
tree | 3e066f258a1dcc645976000935b98b5e89b84072 | |
parent | 91cecf40c5da778627f4d21612f9a4a96217ac0e (diff) | |
download | android_packages_apps_Trebuchet-2e5c432a0aa7e83031575df73bed43a297e2eed3.tar.gz android_packages_apps_Trebuchet-2e5c432a0aa7e83031575df73bed43a297e2eed3.tar.bz2 android_packages_apps_Trebuchet-2e5c432a0aa7e83031575df73bed43a297e2eed3.zip |
Launcher2: fix 2162230 - Can't add app shortcuts from 3D All Apps
-rw-r--r-- | src/com/android/launcher2/DragController.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher2/UserFolder.java | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java index 6994c3244..d4d142458 100644 --- a/src/com/android/launcher2/DragController.java +++ b/src/com/android/launcher2/DragController.java @@ -44,6 +44,8 @@ import java.util.ArrayList; * Class for initiating a drag within a view or across multiple views. */ public class DragController { + private static final String TAG = "Launcher.DragController"; + /** Indicates the drag is a move. */ public static int DRAG_ACTION_MOVE = 0; diff --git a/src/com/android/launcher2/UserFolder.java b/src/com/android/launcher2/UserFolder.java index 1379be6d0..16fe6160c 100644 --- a/src/com/android/launcher2/UserFolder.java +++ b/src/com/android/launcher2/UserFolder.java @@ -3,6 +3,7 @@ package com.android.launcher2; import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.ArrayAdapter; @@ -12,6 +13,8 @@ import android.widget.ArrayAdapter; * */ public class UserFolder extends Folder implements DropTarget { + private static final String TAG = "Launcher.UserFolder"; + public UserFolder(Context context, AttributeSet attrs) { super(context, attrs); } @@ -32,7 +35,8 @@ public class UserFolder extends Folder implements DropTarget { final ItemInfo item = (ItemInfo) dragInfo; final int itemType = item.itemType; return (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION || - itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) && item.container != mInfo.id; + itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) + && item.container != mInfo.id; } public Rect estimateDropLocation(DragSource source, int x, int y, int xOffset, int yOffset, @@ -42,7 +46,11 @@ public class UserFolder extends Folder implements DropTarget { public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, DragView dragView, Object dragInfo) { - final ApplicationInfo item = (ApplicationInfo) dragInfo; + ApplicationInfo item = (ApplicationInfo) dragInfo; + if (item.container == NO_ID) { + // Came from all apps -- make a copy + item = new ApplicationInfo((ApplicationInfo)item); + } //noinspection unchecked ((ArrayAdapter<ApplicationInfo>) mContent.getAdapter()).add((ApplicationInfo) dragInfo); LauncherModel.addOrMoveItemInDatabase(mLauncher, item, mInfo.id, 0, 0, 0); |