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:
parent
5558790e15
commit
d9b3b7b266
@ -360,4 +360,6 @@ object PreferenceKeys {
|
|||||||
const val landscapeVerticalSeekbar = "pref_show_vert_seekbar_landscape"
|
const val landscapeVerticalSeekbar = "pref_show_vert_seekbar_landscape"
|
||||||
|
|
||||||
const val leftVerticalSeekbar = "pref_left_handed_vertical_seekbar"
|
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 cropBordersContinuesVertical() = flowPrefs.getBoolean(Keys.cropBordersContinuesVertical, false)
|
||||||
|
|
||||||
|
fun forceHorizontalSeekbar() = flowPrefs.getBoolean(Keys.forceHorizontalSeekbar, false)
|
||||||
|
|
||||||
fun landscapeVerticalSeekbar() = flowPrefs.getBoolean(Keys.landscapeVerticalSeekbar, false)
|
fun landscapeVerticalSeekbar() = flowPrefs.getBoolean(Keys.landscapeVerticalSeekbar, false)
|
||||||
|
|
||||||
fun leftVerticalSeekbar() = flowPrefs.getBoolean(Keys.leftVerticalSeekbar, false)
|
fun leftVerticalSeekbar() = flowPrefs.getBoolean(Keys.leftVerticalSeekbar, false)
|
||||||
|
@ -839,7 +839,15 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||||||
|
|
||||||
// --> Vertical seekbar hide on landscape
|
// --> 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.readerNavVert.isVisible = true
|
||||||
binding.readerNavHorz.isVisible = false
|
binding.readerNavHorz.isVisible = false
|
||||||
} else {
|
} else {
|
||||||
|
@ -68,6 +68,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BaseBottomShee
|
|||||||
binding.rotationMode.bindToPreference(preferences.rotation(), 1)
|
binding.rotationMode.bindToPreference(preferences.rotation(), 1)
|
||||||
binding.backgroundColor.bindToIntPreference(preferences.readerTheme(), R.array.reader_themes_values)
|
binding.backgroundColor.bindToIntPreference(preferences.readerTheme(), R.array.reader_themes_values)
|
||||||
binding.showPageNumber.bindToPreference(preferences.showPageNumber())
|
binding.showPageNumber.bindToPreference(preferences.showPageNumber())
|
||||||
|
binding.forceHorzSeekbar.bindToPreference(preferences.forceHorizontalSeekbar())
|
||||||
binding.landscapeVerticalSeekbar.bindToPreference(preferences.landscapeVerticalSeekbar())
|
binding.landscapeVerticalSeekbar.bindToPreference(preferences.landscapeVerticalSeekbar())
|
||||||
binding.leftVerticalSeekbar.bindToPreference(preferences.leftVerticalSeekbar())
|
binding.leftVerticalSeekbar.bindToPreference(preferences.leftVerticalSeekbar())
|
||||||
binding.fullscreen.bindToPreference(preferences.fullscreen())
|
binding.fullscreen.bindToPreference(preferences.fullscreen())
|
||||||
|
@ -50,6 +50,12 @@ class SettingsReaderController : SettingsController() {
|
|||||||
summaryRes = R.string.pref_show_reading_mode_summary
|
summaryRes = R.string.pref_show_reading_mode_summary
|
||||||
defaultValue = true
|
defaultValue = true
|
||||||
}
|
}
|
||||||
|
switchPreference {
|
||||||
|
key = Keys.forceHorizontalSeekbar
|
||||||
|
titleRes = R.string.pref_force_horz_seekbar
|
||||||
|
summaryRes = R.string.pref_force_horz_seekbar_summary
|
||||||
|
defaultValue = false
|
||||||
|
}
|
||||||
switchPreference {
|
switchPreference {
|
||||||
key = Keys.landscapeVerticalSeekbar
|
key = Keys.landscapeVerticalSeekbar
|
||||||
titleRes = R.string.pref_show_vert_seekbar_landscape
|
titleRes = R.string.pref_show_vert_seekbar_landscape
|
||||||
|
@ -122,13 +122,21 @@
|
|||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
app:layout_constraintTop_toBottomOf="@id/background_color" />
|
app:layout_constraintTop_toBottomOf="@id/background_color" />
|
||||||
|
|
||||||
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
|
android:id="@+id/force_horz_seekbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/pref_force_horz_seekbar"
|
||||||
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/show_page_number" />
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
android:id="@+id/landscape_vertical_seekbar"
|
android:id="@+id/landscape_vertical_seekbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/pref_show_vert_seekbar_landscape"
|
android:text="@string/pref_show_vert_seekbar_landscape"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
app:layout_constraintTop_toBottomOf="@id/show_page_number" />
|
app:layout_constraintTop_toBottomOf="@id/force_horz_seekbar" />
|
||||||
|
|
||||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||||
android:id="@+id/left_vertical_seekbar"
|
android:id="@+id/left_vertical_seekbar"
|
||||||
|
@ -262,10 +262,6 @@
|
|||||||
<string name="pref_show_page_number">Show page number</string>
|
<string name="pref_show_page_number">Show page number</string>
|
||||||
<string name="pref_show_reading_mode">Show reading mode</string>
|
<string name="pref_show_reading_mode">Show reading mode</string>
|
||||||
<string name="pref_show_reading_mode_summary">Briefly show current mode when reader is opened</string>
|
<string name="pref_show_reading_mode_summary">Briefly show current mode when reader is opened</string>
|
||||||
<string name="pref_show_vert_seekbar_landscape">Show vertical seekbar in landscape</string>
|
|
||||||
<string name="pref_show_vert_seekbar_landscape_summary">Enables vertical seekbar when in landscape</string>
|
|
||||||
<string name="pref_left_handed_vertical_seekbar">Left-handed vertical seekbar</string>
|
|
||||||
<string name="pref_left_handed_vertical_seekbar_summary">Switches which side the seekbar is on</string>
|
|
||||||
<string name="pref_true_color">32-bit color</string>
|
<string name="pref_true_color">32-bit color</string>
|
||||||
<string name="pref_true_color_summary">Reduces banding, but impacts performance</string>
|
<string name="pref_true_color_summary">Reduces banding, but impacts performance</string>
|
||||||
<string name="pref_crop_borders">Crop borders</string>
|
<string name="pref_crop_borders">Crop borders</string>
|
||||||
|
@ -241,6 +241,13 @@
|
|||||||
<string name="tap_scroll_page">Tap scroll by page</string>
|
<string name="tap_scroll_page">Tap scroll by page</string>
|
||||||
<string name="tap_scroll_page_summary">Tapping will scroll by page instead of screen size when this option is enabled</string>
|
<string name="tap_scroll_page_summary">Tapping will scroll by page instead of screen size when this option is enabled</string>
|
||||||
|
|
||||||
|
<string name="pref_show_vert_seekbar_landscape">Show vertical seekbar in landscape</string>
|
||||||
|
<string name="pref_show_vert_seekbar_landscape_summary">Enables vertical seekbar when in landscape</string>
|
||||||
|
<string name="pref_left_handed_vertical_seekbar">Left-handed vertical seekbar</string>
|
||||||
|
<string name="pref_left_handed_vertical_seekbar_summary">Switches which side the seekbar is on</string>
|
||||||
|
<string name="pref_force_horz_seekbar">Force horizontal seekbar</string>
|
||||||
|
<string name="pref_force_horz_seekbar_summary">Removes vertical seekbar entirely in favour of horizontal</string>
|
||||||
|
|
||||||
<!-- Reader -->
|
<!-- Reader -->
|
||||||
<!-- Reader Actions -->
|
<!-- Reader Actions -->
|
||||||
<string name="eh_autoscroll">Autoscroll</string>
|
<string name="eh_autoscroll">Autoscroll</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user