Adjust widgets drawing for missing bottom row

This commit is contained in:
Ensar Sarajčić 2023-07-13 15:55:01 +02:00
parent ec45fc0a1f
commit b49a84968e
1 changed files with 5 additions and 3 deletions

View File

@ -695,9 +695,11 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
rect.left -= diff
}
// do not allow placing widgets at the bottom row, that is for pinned default apps
if (rect.bottom >= context.config.homeRowCount - 1) {
val diff = rect.bottom - context.config.homeRowCount + 2
if (rect.top < 0) {
rect.bottom -= rect.top
rect.top = 0
} else if (rect.bottom > context.config.homeRowCount - 1) {
val diff = rect.bottom - context.config.homeColumnCount + 1
rect.bottom -= diff
rect.top -= diff
}