Fixing crash when uninstalling an app destroys the folder

Bug: 25666490
Bug: 25677822
Change-Id: Id71c04df0a5546ba95239ba2e3f7aabb697375a4
This commit is contained in:
Sunny Goyal
2015-11-14 18:09:20 +05:30
parent 6159c242bc
commit b9c29d455e
+8 -4
View File
@@ -1144,10 +1144,10 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
// addInScreenFromBind() to ensure that hotseat items are placed correctly.
mLauncher.getWorkspace().addInScreenFromBind(newIcon, mInfo.container,
mInfo.screenId, mInfo.cellX, mInfo.cellY, mInfo.spanX, mInfo.spanY);
}
// Focus the newly created child
newIcon.requestFocus();
// Focus the newly created child
newIcon.requestFocus();
}
}
}
};
@@ -1293,7 +1293,11 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
rearrangeChildren();
}
if (getItemCount() <= 1) {
replaceFolderWithFinalItem();
if (mInfo.opened) {
mLauncher.closeFolder(this, true);
} else {
replaceFolderWithFinalItem();
}
}
}