summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2011-12-14 00:43:20 (GMT)
committerDanesh M <daneshm90@gmail.com>2014-05-06 20:47:27 (GMT)
commitaaadc7841203af5492b2cb830cc15bc9375448d7 (patch)
tree616481a8a0e6e6fdd2c9c127388ed98f146892d4
parentd027815092005de1a63d24ab0c06ea0f982b9843 (diff)
downloadandroid_packages_apps_Trebuchet-aaadc7841203af5492b2cb830cc15bc9375448d7.zip
android_packages_apps_Trebuchet-aaadc7841203af5492b2cb830cc15bc9375448d7.tar.gz
android_packages_apps_Trebuchet-aaadc7841203af5492b2cb830cc15bc9375448d7.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: I41d62d04b6b4f0932cc68fb6d2a3be111b063d53
-rw-r--r--src/com/android/launcher3/FolderIcon.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index e80b0f4..9b7919b 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -309,7 +309,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);
}
@@ -437,6 +438,15 @@ public class FolderIcon extends LinearLayout implements FolderListener {
if (d.dragInfo instanceof AppInfo) {
// Came from all apps -- make a copy
item = ((AppInfo) 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;
}