diff options
author | Danesh M <daneshm90@gmail.com> | 2011-12-13 19:43:20 -0500 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-11-19 01:17:25 +0000 |
commit | 5abfd39cdafb0d960bae913f345d31a91b7e05ca (patch) | |
tree | 249a9b9b97f529055fe5aea3d779d4a8f6506ad6 /src/com/cyanogenmod/trebuchet/FolderIcon.java | |
parent | ce6a82b462916cfaa9e7486c3053f43a3cb7393d (diff) | |
download | packages_apps_trebuchet-5abfd39cdafb0d960bae913f345d31a91b7e05ca.zip packages_apps_trebuchet-5abfd39cdafb0d960bae913f345d31a91b7e05ca.tar.gz packages_apps_trebuchet-5abfd39cdafb0d960bae913f345d31a91b7e05ca.tar.bz2 |
Folders: Merge Folders
This allows a folder A's contents to be merged into folder B
when folder A is drag/dropped onto folder B.
Change-Id: Ie9461fa5ccaa02e06b871edd3eb3cf7798070028
Diffstat (limited to 'src/com/cyanogenmod/trebuchet/FolderIcon.java')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/FolderIcon.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/cyanogenmod/trebuchet/FolderIcon.java b/src/com/cyanogenmod/trebuchet/FolderIcon.java index 55aa192..5d2d5f2 100644 --- a/src/com/cyanogenmod/trebuchet/FolderIcon.java +++ b/src/com/cyanogenmod/trebuchet/FolderIcon.java @@ -292,7 +292,8 @@ public class FolderIcon extends LinearLayout implements FolderListener { private boolean willAcceptItem(ItemInfo item) { final int itemType = item.itemType; return ((itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION || - itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) && + itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT || + itemType == LauncherSettings.Favorites.ITEM_TYPE_FOLDER) && !mFolder.isFull() && item != mInfo && !mInfo.opened); } @@ -418,6 +419,15 @@ public class FolderIcon extends LinearLayout implements FolderListener { if (d.dragInfo instanceof ApplicationInfo) { // Came from all apps -- make a copy item = ((ApplicationInfo) d.dragInfo).makeShortcut(); + } else if (d.dragInfo instanceof FolderInfo) { + FolderInfo folder = (FolderInfo) d.dragInfo; + mFolder.notifyDrop(); + for (ShortcutInfo fItem : folder.contents) { + onDrop(fItem, d.dragView, null, 1.0f, mInfo.contents.size(), d.postAnimationRunnable, d); + } + mLauncher.removeFolder(folder); + LauncherModel.deleteItemFromDatabase(mLauncher, folder); + return; } else { item = (ShortcutInfo) d.dragInfo; } |