fix sorting of items in bottom action view

This commit is contained in:
Paul Akhamiogu 2021-12-29 21:29:43 +00:00
parent 7f7780f678
commit f7d5c704f6

View file

@ -37,7 +37,7 @@ class BottomActionMenuView : LinearLayout {
private val inflater = LayoutInflater.from(context)
private val itemsLookup = LinkedHashMap<Int, BottomActionMenuItem>()
private val items: List<BottomActionMenuItem>
get() = itemsLookup.values.toList().sortedWith(compareBy<BottomActionMenuItem> { it.showAsAction }.thenBy { it.icon == View.NO_ID }).filter { it.isVisible }
get() = itemsLookup.values.toList().sortedWith(compareByDescending<BottomActionMenuItem> { it.showAsAction }.thenBy { it.icon != View.NO_ID }).filter { it.isVisible }
private var currentAnimator: ViewPropertyAnimator? = null
private var callback: BottomActionMenuCallback? = null