mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-06-05 21:59:15 +02:00
Properly shift folder items when removing items from folder
This commit is contained in:
@ -242,6 +242,13 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
if (item.id != null) {
|
if (item.id != null) {
|
||||||
context.homeScreenGridItemsDB.deleteById(item.id!!)
|
context.homeScreenGridItemsDB.deleteById(item.id!!)
|
||||||
|
if (item.parentId != null) {
|
||||||
|
gridItems.filter { it.parentId == item.parentId && it.left > item.left && it.id != item.id }.forEach {
|
||||||
|
it.left -= 1
|
||||||
|
}
|
||||||
|
|
||||||
|
context.homeScreenGridItemsDB.shiftFolderItems(item.parentId!!, item.left, -1, item.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.type == ITEM_TYPE_WIDGET) {
|
if (item.type == ITEM_TYPE_WIDGET) {
|
||||||
|
Reference in New Issue
Block a user