mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +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() {
|
private fun showCatSortOptions() {
|
||||||
if (category == null) return
|
val cat = category ?: return
|
||||||
adapter.controller?.activity?.let { activity ->
|
adapter.controller?.activity?.let { activity ->
|
||||||
val items = LibrarySort.entries.map { it.menuSheetItem(category!!.isDynamic) }
|
val items = LibrarySort.entries.map { it.menuSheetItem(cat.isDynamic) }
|
||||||
val sortingMode = category!!.sortingMode(true)
|
val sortingMode = cat.sortingMode(true)
|
||||||
val sheet = MaterialMenuSheet(
|
val sheet = MaterialMenuSheet(
|
||||||
activity,
|
activity,
|
||||||
items,
|
items,
|
||||||
activity.getString(MR.strings.sort_by),
|
activity.getString(MR.strings.sort_by),
|
||||||
sortingMode?.mainValue,
|
sortingMode?.mainValue,
|
||||||
) { sheet, item ->
|
) { sheet, item ->
|
||||||
onCatSortClicked(category!!, item)
|
onCatSortClicked(cat, item)
|
||||||
val nCategory = (adapter.getItem(flexibleAdapterPosition) as? LibraryHeaderItem)?.category
|
val nCategory = (adapter.getItem(flexibleAdapterPosition) as? LibraryHeaderItem)?.category
|
||||||
val isAscending = nCategory?.isAscending() ?: false
|
val isAscending = nCategory?.isAscending() ?: false
|
||||||
val drawableRes = getSortRes(item, isAscending)
|
val drawableRes = getSortRes(item, isAscending)
|
||||||
sheet.setDrawable(item, drawableRes)
|
sheet.setDrawable(item, drawableRes)
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
val isAscending = category!!.isAscending()
|
val isAscending = cat.isAscending()
|
||||||
val drawableRes = getSortRes(sortingMode, isAscending)
|
val drawableRes = getSortRes(sortingMode, isAscending)
|
||||||
sheet.setDrawable(sortingMode?.mainValue ?: -1, drawableRes)
|
sheet.setDrawable(sortingMode?.mainValue ?: -1, drawableRes)
|
||||||
sheet.show()
|
sheet.show()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue