Hide cutout toggle button if fullscreen is off (#6150)
(cherry picked from commit 33a02b47d5e54b207fe2d50cfe0b754db22a6c4b) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderGeneralSettings.kt
This commit is contained in:
parent
ec6b6ae779
commit
af6b42cec7
@ -39,17 +39,19 @@ class ReaderGeneralSettings @JvmOverloads constructor(context: Context, attrs: A
|
||||
binding.backgroundColor.bindToIntPreference(preferences.readerTheme(), R.array.reader_themes_values)
|
||||
binding.showPageNumber.bindToPreference(preferences.showPageNumber())
|
||||
binding.fullscreen.bindToPreference(preferences.fullscreen())
|
||||
preferences.fullscreen()
|
||||
.asImmediateFlow {
|
||||
// If the preference is explicitly disabled, that means the setting was configured since there is a cutout
|
||||
binding.cutoutShort.isVisible = it && ((context as ReaderActivity).hasCutout || !preferences.cutoutShort().get())
|
||||
binding.cutoutShort.bindToPreference(preferences.cutoutShort())
|
||||
}
|
||||
.launchIn((context as ReaderActivity).lifecycleScope)
|
||||
|
||||
binding.keepscreen.bindToPreference(preferences.keepScreenOn())
|
||||
binding.longTap.bindToPreference(preferences.readWithLongTap())
|
||||
binding.alwaysShowChapterTransition.bindToPreference(preferences.alwaysShowChapterTransition())
|
||||
// binding.pageTransitions.bindToPreference(preferences.pageTransitions())
|
||||
|
||||
// If the preference is explicitly disabled, that means the setting was configured since there is a cutout
|
||||
if ((context as ReaderActivity).hasCutout || !preferences.cutoutShort().get()) {
|
||||
binding.cutoutShort.isVisible = true
|
||||
binding.cutoutShort.bindToPreference(preferences.cutoutShort())
|
||||
}
|
||||
|
||||
// SY -->
|
||||
binding.forceHorzSeekbar.bindToPreference(preferences.forceHorizontalSeekbar())
|
||||
binding.landscapeVerticalSeekbar.bindToPreference(preferences.landscapeVerticalSeekbar())
|
||||
|
@ -139,6 +139,7 @@ class SettingsReaderController : SettingsController() {
|
||||
key = Keys.cutoutShort
|
||||
titleRes = R.string.pref_cutout_short
|
||||
defaultValue = true
|
||||
preferences.fullscreen().asImmediateFlow { isVisible = it }.launchIn(viewScope)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user