mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 03:59:19 +01:00
Hide reader cutout setting if no cutout detected
This commit is contained in:
parent
f71708e5c5
commit
2a4f35959b
@ -85,10 +85,14 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia
|
|||||||
background_color.bindToPreference(preferences.readerTheme())
|
background_color.bindToPreference(preferences.readerTheme())
|
||||||
show_page_number.bindToPreference(preferences.showPageNumber())
|
show_page_number.bindToPreference(preferences.showPageNumber())
|
||||||
fullscreen.bindToPreference(preferences.fullscreen())
|
fullscreen.bindToPreference(preferences.fullscreen())
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
||||||
|
val hasDisplayCutout = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P &&
|
||||||
|
activity.window?.decorView?.rootWindowInsets?.displayCutout != null
|
||||||
|
if (hasDisplayCutout) {
|
||||||
cutout_short.visible()
|
cutout_short.visible()
|
||||||
cutout_short.bindToPreference(preferences.cutoutShort())
|
cutout_short.bindToPreference(preferences.cutoutShort())
|
||||||
}
|
}
|
||||||
|
|
||||||
keepscreen.bindToPreference(preferences.keepScreenOn())
|
keepscreen.bindToPreference(preferences.keepScreenOn())
|
||||||
long_tap.bindToPreference(preferences.readWithLongTap())
|
long_tap.bindToPreference(preferences.readWithLongTap())
|
||||||
always_show_chapter_transition.bindToPreference(preferences.alwaysShowChapterTransition())
|
always_show_chapter_transition.bindToPreference(preferences.alwaysShowChapterTransition())
|
||||||
|
@ -77,13 +77,17 @@ class SettingsReaderController : SettingsController() {
|
|||||||
titleRes = R.string.pref_fullscreen
|
titleRes = R.string.pref_fullscreen
|
||||||
defaultValue = true
|
defaultValue = true
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
||||||
|
val hasDisplayCutout = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P &&
|
||||||
|
activity?.window?.decorView?.rootWindowInsets?.displayCutout != null
|
||||||
|
if (hasDisplayCutout) {
|
||||||
switchPreference {
|
switchPreference {
|
||||||
key = Keys.cutoutShort
|
key = Keys.cutoutShort
|
||||||
titleRes = R.string.pref_cutout_short
|
titleRes = R.string.pref_cutout_short
|
||||||
defaultValue = true
|
defaultValue = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switchPreference {
|
switchPreference {
|
||||||
key = Keys.keepScreenOn
|
key = Keys.keepScreenOn
|
||||||
titleRes = R.string.pref_keep_screen_on
|
titleRes = R.string.pref_keep_screen_on
|
||||||
|
Loading…
Reference in New Issue
Block a user