Remove widgets that are out of bounds if they are blocking dropped icon
This commit is contained in:
parent
2349fa019c
commit
200109e527
|
@ -532,7 +532,18 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||
if (item.type != ITEM_TYPE_WIDGET && !item.docked) {
|
||||
potentialParent = item
|
||||
} else {
|
||||
isDroppingPositionValid = false
|
||||
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 {
|
||||
isDroppingPositionValid = false
|
||||
}
|
||||
}
|
||||
return@forEach
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue