summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Folder.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-12-09 17:15:54 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-09 17:15:54 -0800
commitcace67f7ddf467e649604a8b08aa582ce5c33532 (patch)
tree21357b3a777ad0ab5eb9f2c9628157897b44602b /src/com/android/launcher3/Folder.java
parentda41ea669890a79a4d2bc57dab9ae03157fd9e75 (diff)
parent6de1ba3377dd407e83f682edf9ae742416302772 (diff)
downloadandroid_packages_apps_Trebuchet-cace67f7ddf467e649604a8b08aa582ce5c33532.tar.gz
android_packages_apps_Trebuchet-cace67f7ddf467e649604a8b08aa582ce5c33532.tar.bz2
android_packages_apps_Trebuchet-cace67f7ddf467e649604a8b08aa582ce5c33532.zip
am 6de1ba33: Merge "Fixing crash in empty folders. (Bug 11627191)" into jb-ub-now-jolly-elf
* commit '6de1ba3377dd407e83f682edf9ae742416302772': Fixing crash in empty folders. (Bug 11627191)
Diffstat (limited to 'src/com/android/launcher3/Folder.java')
-rw-r--r--src/com/android/launcher3/Folder.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index bbe6af2f6..9637bbb48 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -408,6 +408,15 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mFolderName.setText("");
}
updateItemLocationsInDatabase();
+
+ // In case any children didn't come across during loading, clean up the folder accordingly
+ mFolderIcon.post(new Runnable() {
+ public void run() {
+ if (getItemCount() <= 1) {
+ replaceFolderWithFinalItem();
+ }
+ }
+ });
}
/**
@@ -826,7 +835,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
View v = list.get(i);
ItemInfo info = (ItemInfo) v.getTag();
LauncherModel.moveItemInDatabase(mLauncher, info, mInfo.id, 0,
- info.cellX, info.cellY);
+ info.cellX, info.cellY);
}
}
@@ -1075,7 +1084,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
public void run() {
CellLayout cellLayout = mLauncher.getCellLayout(mInfo.container, mInfo.screenId);
- View child = null;
+ View child = null;
// Move the item from the folder to the workspace, in the position of the folder
if (getItemCount() == 1) {
ShortcutInfo finalItem = mInfo.contents.get(0);
@@ -1105,6 +1114,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
View finalChild = getItemAt(0);
if (finalChild != null) {
mFolderIcon.performDestroyAnimation(finalChild, onCompleteRunnable);
+ } else {
+ onCompleteRunnable.run();
}
mDestroyed = true;
}