From b49a84968e495a5b7629bdd41ad6f16b3ec99575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 13 Jul 2023 15:55:01 +0200 Subject: [PATCH] Adjust widgets drawing for missing bottom row --- .../simplemobiletools/launcher/views/HomeScreenGrid.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt index 79bd6d0..387e8f4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt @@ -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 }