Fix reorder filter crash

This commit is contained in:
Jays2Kings 2021-04-19 17:32:19 -04:00
parent 2670f9b6a4
commit 10a701c211
2 changed files with 5 additions and 2 deletions

View File

@ -43,7 +43,10 @@ class LibraryDisplayView @JvmOverloads constructor(context: Context, attrs: Attr
filterOrder = FilterBottomSheet.Filters.DEFAULT_ORDER
}
val adapter = FlexibleAdapter(
filterOrder.toCharArray().map(::ManageFilterItem),
filterOrder.toCharArray().map {
if (FilterBottomSheet.Filters.filterOf(it) != null) ManageFilterItem(it)
else null
}.filterNotNull(),
this,
true
)

View File

@ -519,7 +519,7 @@ class FilterBottomSheet @JvmOverloads constructor(context: Context, attrs: Attri
Completed,
SeriesType,
Tracked
).joinToString("")
).joinToString("") { it.value.toString() }
fun filterOf(char: Char): Filters? {
return Filters::class.java.enumConstants?.find { it.value == char }