summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2011-12-14 00:43:20 (GMT)
committerAbhisek Devkota <ciwrl@cyanogenmod.com>2014-12-02 01:18:47 (GMT)
commita50bd577ed6148ea3d1c803e140ddbcce71cddb1 (patch)
treec3543faf9480a598df100c8302c7d901993be633
parentb238835749266144bb94a6e83172f0938d5a8c6e (diff)
downloadandroid_packages_apps_Trebuchet-a50bd577ed6148ea3d1c803e140ddbcce71cddb1.zip
android_packages_apps_Trebuchet-a50bd577ed6148ea3d1c803e140ddbcce71cddb1.tar.gz
android_packages_apps_Trebuchet-a50bd577ed6148ea3d1c803e140ddbcce71cddb1.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.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java
index 561ad0d..f52706d 100644
--- a/src/com/android/launcher3/FolderIcon.java
+++ b/src/com/android/launcher3/FolderIcon.java
@@ -489,6 +489,15 @@ public class FolderIcon extends FrameLayout 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;
}