Hide reader cutout setting if no cutout detected
This commit is contained in:
@@ -77,13 +77,17 @@ class SettingsReaderController : SettingsController() {
|
||||
titleRes = R.string.pref_fullscreen
|
||||
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 {
|
||||
key = Keys.cutoutShort
|
||||
titleRes = R.string.pref_cutout_short
|
||||
defaultValue = true
|
||||
}
|
||||
}
|
||||
|
||||
switchPreference {
|
||||
key = Keys.keepScreenOn
|
||||
titleRes = R.string.pref_keep_screen_on
|
||||
|
||||
Reference in New Issue
Block a user