mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-04-24 06:47:27 +02:00
Remove widgets that are out of bounds if they are blocking dropped icon
This commit is contained in:
parent
2349fa019c
commit
200109e527
@ -531,9 +531,20 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||||||
if (isAnyCellOccupied) {
|
if (isAnyCellOccupied) {
|
||||||
if (item.type != ITEM_TYPE_WIDGET && !item.docked) {
|
if (item.type != ITEM_TYPE_WIDGET && !item.docked) {
|
||||||
potentialParent = item
|
potentialParent = item
|
||||||
|
} else {
|
||||||
|
if (item.type == ITEM_TYPE_WIDGET && item.outOfBounds()) {
|
||||||
|
ensureBackgroundThread {
|
||||||
|
removeItemFromHomeScreen(item)
|
||||||
|
post {
|
||||||
|
removeView(widgetViews.firstOrNull { it.tag == item.widgetId })
|
||||||
|
widgetViews.removeIf { it.tag == item.widgetId }
|
||||||
|
}
|
||||||
|
gridItems.removeIf { it.id == item.id }
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
isDroppingPositionValid = false
|
isDroppingPositionValid = false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return@forEach
|
return@forEach
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user