From 8a763b2b9f0b79de6739f8c3a3b62493fe40e280 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Fri, 16 Feb 2024 10:31:36 +0200 Subject: [PATCH] Bring back adaptive reader control preference --- .../org/koitharu/kotatsu/core/prefs/AppSettings.kt | 4 ++++ .../kotatsu/reader/ui/ReaderControlDelegate.kt | 2 +- .../kotatsu/reader/ui/pager/BasePagerReaderFragment.kt | 6 +++++- .../reader/ui/pager/reversed/ReversedReaderFragment.kt | 10 ++++++++++ app/src/main/res/values/strings.xml | 2 +- app/src/main/res/xml/pref_reader.xml | 6 ++++++ 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt index 8a90f03cb..ccde935fb 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/prefs/AppSettings.kt @@ -111,6 +111,9 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) { val isReaderZoomButtonsEnabled: Boolean get() = prefs.getBoolean(KEY_READER_ZOOM_BUTTONS, false) + val isReaderControlAlwaysLTR: Boolean + get() = prefs.getBoolean(KEY_READER_CONTROL_LTR, false) + val isReaderFullscreenEnabled: Boolean get() = prefs.getBoolean(KEY_READER_FULLSCREEN, true) @@ -488,6 +491,7 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) { const val KEY_LOCAL_STORAGE = "local_storage" const val KEY_READER_DOUBLE_PAGES = "reader_double_pages" const val KEY_READER_ZOOM_BUTTONS = "reader_zoom_buttons" + const val KEY_READER_CONTROL_LTR = "reader_taps_ltr" const val KEY_READER_FULLSCREEN = "reader_fullscreen" const val KEY_READER_VOLUME_BUTTONS = "reader_volume_buttons" const val KEY_TRACKER_ENABLED = "tracker_enabled" diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderControlDelegate.kt b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderControlDelegate.kt index f2663d10f..3d5a30044 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderControlDelegate.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderControlDelegate.kt @@ -114,7 +114,7 @@ class ReaderControlDelegate( } private fun isReaderTapsReversed(): Boolean { - return listener.readerMode == ReaderMode.REVERSED + return settings.isReaderControlAlwaysLTR && listener.readerMode == ReaderMode.REVERSED } interface OnInteractionListener { diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/pager/BasePagerReaderFragment.kt b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/pager/BasePagerReaderFragment.kt index 77ce10313..81545d46c 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/pager/BasePagerReaderFragment.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/pager/BasePagerReaderFragment.kt @@ -108,7 +108,7 @@ abstract class BasePagerReaderFragment : BaseReaderFragmentError details:<br><tt>%1$s</tt><br><br>1. Try to <a href="%2$s">open manga in a web browser</a> to ensure it is available on its source<br>2. Make sure you are using the <a href="kotatsu://about">latest version of Kotatsu</a><br>3. If it is available, send an error report to the developers. Show recent manga shortcuts Make recent manga available by long pressing on application icon - Tap on the right edge or pressing the right key always switches to the next page + Navigating next always takes you to the next page when using mouse and keyboard. Ergonomic reader control Color correction Brightness diff --git a/app/src/main/res/xml/pref_reader.xml b/app/src/main/res/xml/pref_reader.xml index 12482f7bc..6c16e961d 100644 --- a/app/src/main/res/xml/pref_reader.xml +++ b/app/src/main/res/xml/pref_reader.xml @@ -51,6 +51,12 @@ android:title="@string/reader_actions" app:allowDividerAbove="true" /> + +