diff options
author | Joe Onorato <joeo@android.com> | 2010-02-08 13:44:00 -0800 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-02-12 12:18:40 -0500 |
commit | 0589f0f66ce498512c6ee47482c649d88294c9d0 (patch) | |
tree | 42d42799a5578bde35a79b18ab8b28d301c663fe /src/com/android/launcher2/FolderIcon.java | |
parent | 3e244cf9d2da4fb04ef095f8b752a2a2c6e2f287 (diff) | |
download | android_packages_apps_Trebuchet-0589f0f66ce498512c6ee47482c649d88294c9d0.tar.gz android_packages_apps_Trebuchet-0589f0f66ce498512c6ee47482c649d88294c9d0.tar.bz2 android_packages_apps_Trebuchet-0589f0f66ce498512c6ee47482c649d88294c9d0.zip |
Split ApplicationInfo into ApplicationInfo which is used for AllAppsView and ShortcutInfo which is
used for the workspace.
Consolidate the three icon resampling functions into one.
Ensure that the icons stored in LauncherProvider are the right size, so we don't have to resample
them each time we load them.
Diffstat (limited to 'src/com/android/launcher2/FolderIcon.java')
-rw-r--r-- | src/com/android/launcher2/FolderIcon.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/launcher2/FolderIcon.java b/src/com/android/launcher2/FolderIcon.java index 85fc3a754..826336c9f 100644 --- a/src/com/android/launcher2/FolderIcon.java +++ b/src/com/android/launcher2/FolderIcon.java @@ -48,7 +48,6 @@ public class FolderIcon extends BubbleTextView implements DropTarget { final Resources resources = launcher.getResources(); Drawable d = resources.getDrawable(R.drawable.ic_launcher_folder); - d = Utilities.createIconThumbnail(d, launcher); icon.mCloseIcon = d; icon.mOpenIcon = resources.getDrawable(R.drawable.ic_launcher_folder_open); icon.setCompoundDrawablesWithIntrinsicBounds(null, d, null, null); @@ -77,8 +76,13 @@ public class FolderIcon extends BubbleTextView implements DropTarget { public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset, DragView dragView, Object dragInfo) { - final ApplicationInfo item = (ApplicationInfo) dragInfo; - // TODO: update open folder that is looking at this data + ShortcutInfo item; + if (dragInfo instanceof ApplicationInfo) { + // Came from all apps -- make a copy + item = ((ApplicationInfo)dragInfo).makeShortcut(); + } else { + item = (ShortcutInfo)dragInfo; + } mInfo.add(item); LauncherModel.addOrMoveItemInDatabase(mLauncher, item, mInfo.id, 0, 0, 0); } |