From acb8ab15b2e73ba2f161eb201e93ba3a36df2867 Mon Sep 17 00:00:00 2001 From: Andreas Date: Fri, 23 Sep 2022 04:29:15 +0200 Subject: [PATCH] Recreate reader settings when opening sheet (#8054) --- .../ui/reader/setting/ReaderSettingsSheet.kt | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt index 14386d3c55..5d6dd6167c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt @@ -13,9 +13,19 @@ class ReaderSettingsSheet( private val showColorFilterSettings: Boolean = false, ) : TabbedBottomSheetDialog(activity) { - private val readingModeSettings = ReaderReadingModeSettings(activity) - private val generalSettings = ReaderGeneralSettings(activity) - private val colorFilterSettings = ReaderColorFilterSettings(activity) + private lateinit var readingModeSettings: ReaderReadingModeSettings + private lateinit var generalSettings: ReaderGeneralSettings + private lateinit var colorFilterSettings: ReaderColorFilterSettings + + init { + initSettings() + } + + private fun initSettings() { + readingModeSettings = ReaderReadingModeSettings(activity) + generalSettings = ReaderGeneralSettings(activity) + colorFilterSettings = ReaderColorFilterSettings(activity) + } private val backgroundDimAnimator by lazy { val sheetBackgroundDim = window?.attributes?.dimAmount ?: 0.25f @@ -74,4 +84,9 @@ class ReaderSettingsSheet( R.string.pref_category_general, R.string.custom_filter, ) + + override fun show() { + initSettings() + super.show() + } }