diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt index 628a97896c..e9f6e506ee 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupRestorer.kt @@ -411,14 +411,6 @@ class BackupRestorer(val context: Context, val notifier: BackupNotifier) { return@forEach } // end j2k fork differences - - // <-- yokai - if (key == "cutout_short" && value is BooleanPreferenceValue) { - preferenceStore.getEnum(PreferenceKeys.pagerCutoutBehavior, CutoutBehaviour.SHOW) - .set(if (value.value) CutoutBehaviour.SHOW else CutoutBehaviour.HIDE) - return@forEach - } - // --> yokai when (value) { is IntPreferenceValue -> { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt index 5c21a413ee..cc266fa4ce 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt @@ -126,31 +126,6 @@ class SettingsReaderController : SettingsController() { titleRes = R.string.show_page_number defaultValue = true } - listPreference(activity) { - bindTo(readerPreferences.pagerCutoutBehavior()) - titleRes = R.string.cutout_area_behavior - val values = CutoutBehaviour.entries - entriesRes = values.map { it.titleResId }.toTypedArray() - entryValues = values.map { it.name }.toTypedArray().toList() - // Calling this once to show only on cutout - isVisible = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - activityBinding?.root?.rootWindowInsets?.displayCutout?.safeInsetTop != null || - activityBinding?.root?.rootWindowInsets?.displayCutout?.safeInsetBottom != null - } else { - false - } && preferences.fullscreen().get() - // Calling this a second time in case activity is recreated while on this page - // Keep the first so it shouldn't animate hiding the preference for phones without - // cutouts - activityBinding?.root?.post { - isVisible = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { - activityBinding?.root?.rootWindowInsets?.displayCutout?.safeInsetTop != null || - activityBinding?.root?.rootWindowInsets?.displayCutout?.safeInsetBottom != null - } else { - false - } && preferences.fullscreen().get() - } - } listPreference(activity) { bindTo(readerPreferences.landscapeCutoutBehavior()) title = "${context.getString(R.string.cutout_area_behavior)} (${context.getString(R.string.landscape)})" @@ -230,6 +205,32 @@ class SettingsReaderController : SettingsController() { defaultValue = 1 } + listPreference(activity) { + bindTo(readerPreferences.pagerCutoutBehavior()) + titleRes = R.string.cutout_area_behavior + val values = CutoutBehaviour.entries + entriesRes = values.map { it.titleResId }.toTypedArray() + entryValues = values.map { it.name }.toTypedArray().toList() + // Calling this once to show only on cutout + isVisible = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + activityBinding?.root?.rootWindowInsets?.displayCutout?.safeInsetTop != null || + activityBinding?.root?.rootWindowInsets?.displayCutout?.safeInsetBottom != null + } else { + false + } && preferences.fullscreen().get() + // Calling this a second time in case activity is recreated while on this page + // Keep the first so it shouldn't animate hiding the preference for phones without + // cutouts + activityBinding?.root?.post { + isVisible = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + activityBinding?.root?.rootWindowInsets?.displayCutout?.safeInsetTop != null || + activityBinding?.root?.rootWindowInsets?.displayCutout?.safeInsetBottom != null + } else { + false + } && preferences.fullscreen().get() + } + } + switchPreference { bindTo(preferences.landscapeZoom()) titleRes = R.string.zoom_double_page_spreads