mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-27 09:44:55 +03:00
Recreate reader settings when opening sheet (#8054)
This commit is contained in:
parent
5cdcc1679f
commit
acb8ab15b2
1 changed files with 18 additions and 3 deletions
|
@ -13,9 +13,19 @@ class ReaderSettingsSheet(
|
||||||
private val showColorFilterSettings: Boolean = false,
|
private val showColorFilterSettings: Boolean = false,
|
||||||
) : TabbedBottomSheetDialog(activity) {
|
) : TabbedBottomSheetDialog(activity) {
|
||||||
|
|
||||||
private val readingModeSettings = ReaderReadingModeSettings(activity)
|
private lateinit var readingModeSettings: ReaderReadingModeSettings
|
||||||
private val generalSettings = ReaderGeneralSettings(activity)
|
private lateinit var generalSettings: ReaderGeneralSettings
|
||||||
private val colorFilterSettings = ReaderColorFilterSettings(activity)
|
private lateinit var colorFilterSettings: ReaderColorFilterSettings
|
||||||
|
|
||||||
|
init {
|
||||||
|
initSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initSettings() {
|
||||||
|
readingModeSettings = ReaderReadingModeSettings(activity)
|
||||||
|
generalSettings = ReaderGeneralSettings(activity)
|
||||||
|
colorFilterSettings = ReaderColorFilterSettings(activity)
|
||||||
|
}
|
||||||
|
|
||||||
private val backgroundDimAnimator by lazy {
|
private val backgroundDimAnimator by lazy {
|
||||||
val sheetBackgroundDim = window?.attributes?.dimAmount ?: 0.25f
|
val sheetBackgroundDim = window?.attributes?.dimAmount ?: 0.25f
|
||||||
|
@ -74,4 +84,9 @@ class ReaderSettingsSheet(
|
||||||
R.string.pref_category_general,
|
R.string.pref_category_general,
|
||||||
R.string.custom_filter,
|
R.string.custom_filter,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
override fun show() {
|
||||||
|
initSettings()
|
||||||
|
super.show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue