Fixed crash in some cases when opening reader from recents

Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com>
This commit is contained in:
Jays2Kings 2021-05-06 15:30:41 -04:00
parent e4b5f084a9
commit 03b305ed8f
2 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,9 @@ class RecentMangaAdapter(val delegate: RecentsInterface) :
init { init {
setDisplayHeadersAtStartUp(true) setDisplayHeadersAtStartUp(true)
}
fun setPreferenceFlows() {
preferences.showRecentsDownloads().register { showDownloads = it } preferences.showRecentsDownloads().register { showDownloads = it }
preferences.showRecentsRemHistory().register { showRemoveHistory = it } preferences.showRecentsRemHistory().register { showRemoveHistory = it }
preferences.showTitleFirstInRecents().register { showTitleFirst = it } preferences.showTitleFirstInRecents().register { showTitleFirst = it }

View File

@ -133,6 +133,7 @@ class RecentsController(bundle: Bundle? = null) :
super.onViewCreated(view) super.onViewCreated(view)
// Initialize adapter // Initialize adapter
adapter = RecentMangaAdapter(this) adapter = RecentMangaAdapter(this)
adapter.setPreferenceFlows()
binding.recycler.adapter = adapter binding.recycler.adapter = adapter
binding.recycler.layoutManager = LinearLayoutManager(view.context) binding.recycler.layoutManager = LinearLayoutManager(view.context)
binding.recycler.setHasFixedSize(true) binding.recycler.setHasFixedSize(true)