diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt
index d9b3574956..c55c0d7155 100644
--- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt
+++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt
@@ -317,6 +317,11 @@ object SettingsReaderScreen : SearchableSettings {
subtitle = stringResource(R.string.split_tall_images_summary),
enabled = !isReleaseBuildType, // TODO: Show in release build when the feature is stable
),
+ Preference.PreferenceItem.SwitchPreference(
+ pref = readerPreferences.webtoonDoubleTapZoomEnabled(),
+ title = stringResource(R.string.pref_double_tap_zoom),
+ enabled = true,
+ ),
),
)
}
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt
index ca4ca7be52..b2b82ea97e 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderPreferences.kt
@@ -34,6 +34,8 @@ class ReaderPreferences(
// TODO: Enable in release build when the feature is stable
fun longStripSplitWebtoon() = preferenceStore.getBoolean("pref_long_strip_split_webtoon", !isReleaseBuildType)
+ fun webtoonDoubleTapZoomEnabled() = preferenceStore.getBoolean("pref_enable_double_tap_zoom_webtoon", true)
+
fun imageScaleType() = preferenceStore.getInt("pref_image_scale_type_key", 1)
fun zoomStart() = preferenceStore.getInt("pref_zoom_start_key", 1)
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt
index e143002866..a3b9a42f1a 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderReadingModeSettings.kt
@@ -140,5 +140,7 @@ class ReaderReadingModeSettings @JvmOverloads constructor(context: Context, attr
binding.webtoonPrefsGroup.longStripSplit.isVisible = !isReleaseBuildType
binding.webtoonPrefsGroup.longStripSplit.bindToPreference(readerPreferences.longStripSplitWebtoon())
+
+ binding.webtoonPrefsGroup.doubleTapZoom.bindToPreference(readerPreferences.webtoonDoubleTapZoomEnabled())
}
}
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt
index c168a63669..b2e0045b8f 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonConfig.kt
@@ -37,6 +37,11 @@ class WebtoonConfig(
var longStripSplitChangedListener: ((Boolean) -> Unit)? = null
+ var doubleTapZoom = true
+ private set
+
+ var doubleTapZoomChangedListener: ((Boolean) -> Unit)? = null
+
val theme = readerPreferences.readerTheme().get()
init {
@@ -71,6 +76,12 @@ class WebtoonConfig(
},
)
+ readerPreferences.webtoonDoubleTapZoomEnabled()
+ .register(
+ { doubleTapZoom = it },
+ { doubleTapZoomChangedListener?.invoke(it) },
+ )
+
readerPreferences.readerTheme().changes()
.drop(1)
.distinctUntilChanged()
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt
index 323cf0f63f..43c981b25e 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt
@@ -25,6 +25,13 @@ class WebtoonFrame(context: Context) : FrameLayout(context) {
*/
private val flingDetector = GestureDetector(context, FlingListener())
+ var doubleTapZoom = true
+ set(value) {
+ field = value
+ recycler?.doubleTapZoom = value
+ scaleDetector.isQuickScaleEnabled = value
+ }
+
/**
* Recycler view added in this frame.
*/
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt
index 7a3b966767..b6abc4834c 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonRecyclerView.kt
@@ -37,6 +37,8 @@ class WebtoonRecyclerView @JvmOverloads constructor(
private val listener = GestureListener()
private val detector = Detector()
+ var doubleTapZoom = true
+
var tapListener: ((MotionEvent) -> Unit)? = null
var longTapListener: ((MotionEvent) -> Boolean)? = null
@@ -209,7 +211,7 @@ class WebtoonRecyclerView @JvmOverloads constructor(
}
fun onDoubleTapConfirmed(ev: MotionEvent) {
- if (!isZooming) {
+ if (!isZooming && doubleTapZoom) {
if (scaleX != DEFAULT_RATE) {
zoom(currentScale, DEFAULT_RATE, x, 0f, y, 0f)
} else {
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt
index 037d64e316..dab54cec9c 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt
@@ -142,6 +142,10 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
ActivityCompat.recreate(activity)
}
+ config.doubleTapZoomChangedListener = {
+ frame.doubleTapZoom = it
+ }
+
config.navigationModeChangedListener = {
val showOnStart = config.navigationOverlayOnStart || config.forceNavigationOverlay
activity.binding.navigationOverlay.setNavigation(config.navigator, showOnStart)
diff --git a/app/src/main/res/layout/reader_webtoon_settings.xml b/app/src/main/res/layout/reader_webtoon_settings.xml
index ff0ddb7669..2d5bb7b01d 100644
--- a/app/src/main/res/layout/reader_webtoon_settings.xml
+++ b/app/src/main/res/layout/reader_webtoon_settings.xml
@@ -75,6 +75,15 @@
android:text="@string/pref_long_strip_split"
android:textColor="?android:attr/textColorSecondary" />
+
+
Rotate wide pages to fit
Flip orientation of rotated wide pages
Split tall images (BETA)
+ Double tap to zoom
Show content in cutout area
Animate page transitions
Double tap animation speed