mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 06:31:52 +01:00
Fix reader settings sheet not updated (#8854)
* Revert "Recreate reader settings when opening sheet (#8054)" This reverts commitacb8ab15b2
. * Revert "Fix stacking of Settings menu in the reader on multiple taps (#8002)" This reverts commit30ac94181b
. * Fix reader settings sheet not updated
This commit is contained in:
parent
817418f7c9
commit
0861c5618c
@ -558,15 +558,17 @@ class ReaderActivity : BaseActivity() {
|
|||||||
// Settings sheet
|
// Settings sheet
|
||||||
with(binding.actionSettings) {
|
with(binding.actionSettings) {
|
||||||
setTooltip(R.string.action_settings)
|
setTooltip(R.string.action_settings)
|
||||||
val readerSettingSheetDialog = ReaderSettingsSheet(this@ReaderActivity)
|
|
||||||
|
var readerSettingSheet: ReaderSettingsSheet? = null
|
||||||
|
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
if (!readerSettingSheetDialog.isShowing()) {
|
if (readerSettingSheet?.isShowing == true) return@setOnClickListener
|
||||||
readerSettingSheetDialog.show()
|
readerSettingSheet = ReaderSettingsSheet(this@ReaderActivity).apply { show() }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setOnLongClickListener {
|
setOnLongClickListener {
|
||||||
ReaderSettingsSheet(this@ReaderActivity, showColorFilterSettings = true).show()
|
if (readerSettingSheet?.isShowing == true) return@setOnLongClickListener false
|
||||||
|
readerSettingSheet = ReaderSettingsSheet(this@ReaderActivity, showColorFilterSettings = true).apply { show() }
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,19 +13,9 @@ class ReaderSettingsSheet(
|
|||||||
private val showColorFilterSettings: Boolean = false,
|
private val showColorFilterSettings: Boolean = false,
|
||||||
) : TabbedBottomSheetDialog(activity) {
|
) : TabbedBottomSheetDialog(activity) {
|
||||||
|
|
||||||
private lateinit var readingModeSettings: ReaderReadingModeSettings
|
private val readingModeSettings = ReaderReadingModeSettings(activity)
|
||||||
private lateinit var generalSettings: ReaderGeneralSettings
|
private val generalSettings = ReaderGeneralSettings(activity)
|
||||||
private lateinit var colorFilterSettings: ReaderColorFilterSettings
|
private val colorFilterSettings = ReaderColorFilterSettings(activity)
|
||||||
|
|
||||||
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
|
||||||
@ -84,9 +74,4 @@ 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 New Issue
Block a user