Merge pull request #134 from esensar/fix/129-widget-placing-issue

Prevent widgets overlap with items from other pages
This commit is contained in:
Tibor Kaputa 2023-09-21 09:59:28 +02:00 committed by GitHub
commit 6e9d8686bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -366,7 +366,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
val viewX = widgetView.x.toInt() val viewX = widgetView.x.toInt()
val viewY = widgetView.y.toInt() val viewY = widgetView.y.toInt()
val frameRect = Rect(viewX, viewY, viewX + widgetView.width, viewY + widgetView.height) val frameRect = Rect(viewX, viewY, viewX + widgetView.width, viewY + widgetView.height)
val otherGridItems = gridItems.filter { it.widgetId != item.widgetId }.toMutableList() as ArrayList<HomeScreenGridItem> val otherGridItems = gridItems.filterVisibleOnCurrentPageOnly().filter { it.widgetId != item.widgetId }.toMutableList() as ArrayList<HomeScreenGridItem>
binding.resizeFrame.updateFrameCoords(frameRect, cellWidth, cellHeight, sideMargins, item, otherGridItems) binding.resizeFrame.updateFrameCoords(frameRect, cellWidth, cellHeight, sideMargins, item, otherGridItems)
binding.resizeFrame.beVisible() binding.resizeFrame.beVisible()
binding.resizeFrame.z = 1f // make sure the frame isnt behind the widget itself binding.resizeFrame.z = 1f // make sure the frame isnt behind the widget itself