From 310f81f850150ef88b920b14bf58713b19d6df07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Mon, 31 Jul 2023 10:35:32 +0200 Subject: [PATCH] Use a getter for iconSize instead of property access --- .../simplemobiletools/launcher/activities/MainActivity.kt | 2 +- .../com/simplemobiletools/launcher/views/HomeScreenGrid.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt index 6069576..c07acac 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt @@ -528,7 +528,7 @@ class MainActivity : SimpleActivity(), FlingListener { y - iconSize / 2f } else { val clickableRect = home_screen_grid.getClickableRect(gridItem) - clickableRect.top.toFloat() - home_screen_grid.iconSize / 2f + clickableRect.top.toFloat() - home_screen_grid.getCurrentIconSize() / 2f } home_screen_popup_menu_anchor.x = x 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 db7913d..1a3a286 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt @@ -67,8 +67,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel private var resizedWidget: HomeScreenGridItem? = null private var isFirstDraw = true private var redrawWidgets = false - var iconSize = 0 - private set + private var iconSize = 0 private var lastPage = 0 private var currentPage = 0 @@ -1081,6 +1080,8 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel return false } + fun getCurrentIconSize(): Int = iconSize + private fun handlePageChange(redraw: Boolean = false) { pageChangeEnabled = false pageChangeIndicatorsAlpha = 0f