From 10a701c21111224c5349a34f72d511832971c4a0 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Mon, 19 Apr 2021 17:32:19 -0400 Subject: [PATCH] Fix reorder filter crash --- .../tachiyomi/ui/library/display/LibraryDisplayView.kt | 5 ++++- .../kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/display/LibraryDisplayView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/display/LibraryDisplayView.kt index 6453f035a4..2e3247b702 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/display/LibraryDisplayView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/display/LibraryDisplayView.kt @@ -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 ) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt index a10ce08259..433468c69b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/filter/FilterBottomSheet.kt @@ -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 }