From 464adc73094c2c45945091a1d7700ed49c7e6734 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 16 Oct 2022 23:28:15 +0200 Subject: [PATCH] correcting some menu offsets --- .../simplemobiletools/launcher/activities/MainActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 863b288..5a88b48 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt @@ -486,10 +486,10 @@ class MainActivity : SimpleActivity(), FlingListener { private fun handleGridItemPopupMenu(anchorView: View, gridItem: HomeScreenGridItem, isOnAllAppsFragment: Boolean): PopupMenu { var visibleMenuButtons = 5 - if (gridItem.type == ITEM_TYPE_ICON) { - visibleMenuButtons -= 1 - } else { - visibleMenuButtons -= 2 + visibleMenuButtons -= when (gridItem.type) { + ITEM_TYPE_ICON -> 1 + ITEM_TYPE_WIDGET -> 3 + else -> 4 } if (isOnAllAppsFragment) {