From 03b305ed8f311eccb6c9e1eb8d73bcada9089528 Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Thu, 6 May 2021 15:30:41 -0400 Subject: [PATCH] Fixed crash in some cases when opening reader from recents Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com> --- .../java/eu/kanade/tachiyomi/ui/recents/RecentMangaAdapter.kt | 3 +++ .../java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt | 1 + 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaAdapter.kt index 48034f63ad..c87921c9ba 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentMangaAdapter.kt @@ -38,6 +38,9 @@ class RecentMangaAdapter(val delegate: RecentsInterface) : init { setDisplayHeadersAtStartUp(true) + } + + fun setPreferenceFlows() { preferences.showRecentsDownloads().register { showDownloads = it } preferences.showRecentsRemHistory().register { showRemoveHistory = it } preferences.showTitleFirstInRecents().register { showTitleFirst = it } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt index 972fada593..1a07ee6905 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recents/RecentsController.kt @@ -133,6 +133,7 @@ class RecentsController(bundle: Bundle? = null) : super.onViewCreated(view) // Initialize adapter adapter = RecentMangaAdapter(this) + adapter.setPreferenceFlows() binding.recycler.adapter = adapter binding.recycler.layoutManager = LinearLayoutManager(view.context) binding.recycler.setHasFixedSize(true)