mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +00:00
fix(library): Don't use double-bang
This commit is contained in:
parent
c1cb7a2066
commit
3d2e2b2774
1 changed files with 5 additions and 5 deletions
|
@ -260,24 +260,24 @@ class LibraryHeaderHolder(val view: View, val adapter: LibraryCategoryAdapter) :
|
|||
}
|
||||
|
||||
private fun showCatSortOptions() {
|
||||
if (category == null) return
|
||||
val cat = category ?: return
|
||||
adapter.controller?.activity?.let { activity ->
|
||||
val items = LibrarySort.entries.map { it.menuSheetItem(category!!.isDynamic) }
|
||||
val sortingMode = category!!.sortingMode(true)
|
||||
val items = LibrarySort.entries.map { it.menuSheetItem(cat.isDynamic) }
|
||||
val sortingMode = cat.sortingMode(true)
|
||||
val sheet = MaterialMenuSheet(
|
||||
activity,
|
||||
items,
|
||||
activity.getString(MR.strings.sort_by),
|
||||
sortingMode?.mainValue,
|
||||
) { sheet, item ->
|
||||
onCatSortClicked(category!!, item)
|
||||
onCatSortClicked(cat, item)
|
||||
val nCategory = (adapter.getItem(flexibleAdapterPosition) as? LibraryHeaderItem)?.category
|
||||
val isAscending = nCategory?.isAscending() ?: false
|
||||
val drawableRes = getSortRes(item, isAscending)
|
||||
sheet.setDrawable(item, drawableRes)
|
||||
false
|
||||
}
|
||||
val isAscending = category!!.isAscending()
|
||||
val isAscending = cat.isAscending()
|
||||
val drawableRes = getSortRes(sortingMode, isAscending)
|
||||
sheet.setDrawable(sortingMode?.mainValue ?: -1, drawableRes)
|
||||
sheet.show()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue