From f7d5c704f6897869c91b1882a607233601bff340 Mon Sep 17 00:00:00 2001 From: Paul Akhamiogu Date: Wed, 29 Dec 2021 21:29:43 +0000 Subject: [PATCH] fix sorting of items in bottom action view --- .../commons/views/bottomactionmenu/BottomActionMenuView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/views/bottomactionmenu/BottomActionMenuView.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/views/bottomactionmenu/BottomActionMenuView.kt index 3aa37425a..cba0cc786 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/views/bottomactionmenu/BottomActionMenuView.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/views/bottomactionmenu/BottomActionMenuView.kt @@ -37,7 +37,7 @@ class BottomActionMenuView : LinearLayout { private val inflater = LayoutInflater.from(context) private val itemsLookup = LinkedHashMap() private val items: List - get() = itemsLookup.values.toList().sortedWith(compareBy { it.showAsAction }.thenBy { it.icon == View.NO_ID }).filter { it.isVisible } + get() = itemsLookup.values.toList().sortedWith(compareByDescending { it.showAsAction }.thenBy { it.icon != View.NO_ID }).filter { it.isVisible } private var currentAnimator: ViewPropertyAnimator? = null private var callback: BottomActionMenuCallback? = null