From dcafdac036155df76d1f8b013ca1d08634fd57c2 Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Wed, 27 Jul 2022 20:00:18 +0700 Subject: [PATCH] Retain backstack views by default (#7621) --- .../eu/kanade/tachiyomi/ui/base/controller/BaseController.kt | 2 ++ .../java/eu/kanade/tachiyomi/ui/library/LibraryController.kt | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt index 18bf71abf8..9003b2ce30 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt @@ -23,6 +23,8 @@ abstract class BaseController(bundle: Bundle? = null) : Contro lateinit var viewScope: CoroutineScope init { + retainViewMode = RetainViewMode.RETAIN_DETACH + addLifecycleListener( object : LifecycleListener() { override fun postCreateView(controller: Controller, view: View) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 4001d1d21a..a1f9553f0f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -40,10 +40,6 @@ class LibraryController( */ private var settingsSheet: LibrarySettingsSheet? = null - init { - retainViewMode = RetainViewMode.RETAIN_DETACH - } - override fun createPresenter(): LibraryPresenter = LibraryPresenter() @Composable