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 bc60037e9..a0a2e8f97 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
@@ -341,7 +341,10 @@ object SettingsReaderScreen : SearchableSettings {
Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.webtoonDoubleTapZoomEnabled(),
title = stringResource(MR.strings.pref_double_tap_zoom),
- enabled = true,
+ ),
+ Preference.PreferenceItem.SwitchPreference(
+ pref = readerPreferences.webtoonDisableZoomOut(),
+ title = stringResource(MR.strings.pref_webtoon_disable_zoom_out),
),
),
)
diff --git a/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt b/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt
index ee2eb854f..fb3e16a93 100644
--- a/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt
+++ b/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt
@@ -197,6 +197,10 @@ private fun ColumnScope.WebtoonViewerSettings(screenModel: ReaderSettingsScreenM
label = stringResource(MR.strings.pref_double_tap_zoom),
pref = screenModel.preferences.webtoonDoubleTapZoomEnabled(),
)
+ CheckboxItem(
+ label = stringResource(MR.strings.pref_webtoon_disable_zoom_out),
+ pref = screenModel.preferences.webtoonDisableZoomOut(),
+ )
}
@Composable
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 6c079b836..53e342e76 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
@@ -72,6 +72,8 @@ class ReaderPreferences(
fun skipDupe() = preferenceStore.getBoolean("skip_dupe", false)
+ fun webtoonDisableZoomOut() = preferenceStore.getBoolean("webtoon_disable_zoom_out", false)
+
// endregion
// region Split two page spread
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 28ad91a51..f55478862 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
@@ -29,6 +29,11 @@ class WebtoonConfig(
var imageCropBorders = false
private set
+ var zoomOutDisabled = false
+ private set
+
+ var zoomPropertyChangedListener: ((Boolean) -> Unit)? = null
+
var sidePadding = 0
private set
@@ -74,6 +79,12 @@ class WebtoonConfig(
{ imagePropertyChangedListener?.invoke() },
)
+ readerPreferences.webtoonDisableZoomOut()
+ .register(
+ { zoomOutDisabled = it },
+ { zoomPropertyChangedListener?.invoke(it) }
+ )
+
readerPreferences.webtoonDoubleTapZoomEnabled()
.register(
{ doubleTapZoom = it },
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 572335b25..17aafc6fd 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
@@ -33,6 +33,12 @@ class WebtoonFrame(context: Context) : FrameLayout(context) {
scaleDetector.isQuickScaleEnabled = value
}
+ var zoomOutDisabled = false
+ set(value) {
+ field = value
+ recycler?.zoomOutDisabled = 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 d86619cdf..20c18c622 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
@@ -33,6 +33,15 @@ class WebtoonRecyclerView @JvmOverloads constructor(
private var firstVisibleItemPosition = 0
private var lastVisibleItemPosition = 0
private var currentScale = DEFAULT_RATE
+ var zoomOutDisabled = false
+ set(value) {
+ field = value
+ if (value && currentScale < DEFAULT_RATE) {
+ zoom(currentScale, DEFAULT_RATE, x, 0f, y, 0f)
+ }
+ }
+ private val minRate
+ get() = if (zoomOutDisabled) DEFAULT_RATE else MIN_RATE
private val listener = GestureListener()
private val detector = Detector()
@@ -166,7 +175,7 @@ class WebtoonRecyclerView @JvmOverloads constructor(
fun onScale(scaleFactor: Float) {
currentScale *= scaleFactor
currentScale = currentScale.coerceIn(
- MIN_RATE,
+ minRate,
MAX_SCALE_RATE,
)
@@ -193,8 +202,8 @@ class WebtoonRecyclerView @JvmOverloads constructor(
}
fun onScaleEnd() {
- if (scaleX < MIN_RATE) {
- zoom(currentScale, MIN_RATE, x, 0f, y, 0f)
+ if (scaleX < minRate) {
+ zoom(currentScale, minRate, x, 0f, y, 0f)
}
}
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 da11e68ff..1e370a8c7 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
@@ -152,6 +152,10 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
frame.doubleTapZoom = it
}
+ config.zoomPropertyChangedListener = {
+ frame.zoomOutDisabled = it
+ }
+
config.navigationModeChangedListener = {
val showOnStart = config.navigationOverlayOnStart || config.forceNavigationOverlay
activity.binding.navigationOverlay.setNavigation(config.navigator, showOnStart)
diff --git a/i18n/src/commonMain/resources/MR/base/strings.xml b/i18n/src/commonMain/resources/MR/base/strings.xml
index 5214e41a8..6c6e1681a 100644
--- a/i18n/src/commonMain/resources/MR/base/strings.xml
+++ b/i18n/src/commonMain/resources/MR/base/strings.xml
@@ -453,6 +453,7 @@
High
Low
Lowest
+ Disable zoom out
Delete chapters