Add option to force disable vertical seekbar

(cherry picked from commit b5df33bf14d4eea8421d2e1e6b488b79e6daa9f5)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
#	app/src/main/java/exh/log/Logging.kt
This commit is contained in:
CrepeTF
2021-03-20 18:42:51 +00:00
committed by Jobobby04
parent 5558790e15
commit d9b3b7b266
8 changed files with 36 additions and 6 deletions
@@ -360,4 +360,6 @@ object PreferenceKeys {
const val landscapeVerticalSeekbar = "pref_show_vert_seekbar_landscape"
const val leftVerticalSeekbar = "pref_left_handed_vertical_seekbar"
const val forceHorizontalSeekbar = "pref_force_horz_seekbar"
}
@@ -467,6 +467,8 @@ class PreferencesHelper(val context: Context) {
fun cropBordersContinuesVertical() = flowPrefs.getBoolean(Keys.cropBordersContinuesVertical, false)
fun forceHorizontalSeekbar() = flowPrefs.getBoolean(Keys.forceHorizontalSeekbar, false)
fun landscapeVerticalSeekbar() = flowPrefs.getBoolean(Keys.landscapeVerticalSeekbar, false)
fun leftVerticalSeekbar() = flowPrefs.getBoolean(Keys.leftVerticalSeekbar, false)
@@ -839,7 +839,15 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
// --> Vertical seekbar hide on landscape
if (((resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE && preferences.landscapeVerticalSeekbar().get()) || resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) && (viewer is WebtoonViewer || viewer is VerticalPagerViewer)) {
if (
!preferences.forceHorizontalSeekbar().get() &&
(
(
resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE && preferences.landscapeVerticalSeekbar().get()) ||
resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT
)
&& (viewer is WebtoonViewer || viewer is VerticalPagerViewer)
) {
binding.readerNavVert.isVisible = true
binding.readerNavHorz.isVisible = false
} else {
@@ -68,6 +68,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BaseBottomShee
binding.rotationMode.bindToPreference(preferences.rotation(), 1)
binding.backgroundColor.bindToIntPreference(preferences.readerTheme(), R.array.reader_themes_values)
binding.showPageNumber.bindToPreference(preferences.showPageNumber())
binding.forceHorzSeekbar.bindToPreference(preferences.forceHorizontalSeekbar())
binding.landscapeVerticalSeekbar.bindToPreference(preferences.landscapeVerticalSeekbar())
binding.leftVerticalSeekbar.bindToPreference(preferences.leftVerticalSeekbar())
binding.fullscreen.bindToPreference(preferences.fullscreen())
@@ -50,6 +50,12 @@ class SettingsReaderController : SettingsController() {
summaryRes = R.string.pref_show_reading_mode_summary
defaultValue = true
}
switchPreference {
key = Keys.forceHorizontalSeekbar
titleRes = R.string.pref_force_horz_seekbar
summaryRes = R.string.pref_force_horz_seekbar_summary
defaultValue = false
}
switchPreference {
key = Keys.landscapeVerticalSeekbar
titleRes = R.string.pref_show_vert_seekbar_landscape