Added settings to enable/disable zoom/pan gestures.

This commit is contained in:
Koen 2024-01-11 15:48:58 +01:00
parent fdd7e32dd8
commit 84e3373fa7
3 changed files with 12 additions and 2 deletions

View file

@ -830,6 +830,12 @@ class Settings : FragmentedStorageFileJson() {
@FormField(R.string.restore_system_brightness, FieldForm.TOGGLE, R.string.restore_system_brightness_descr, 6)
var restoreSystemBrightness: Boolean = true;
@FormField(R.string.zoom_option, FieldForm.TOGGLE, R.string.zoom_option_descr, 7)
var zoom: Boolean = true;
@FormField(R.string.pan_option, FieldForm.TOGGLE, R.string.pan_option_descr, 8)
var pan: Boolean = true;
}
@FormField(R.string.info, FieldForm.GROUP, -1, 20)

View file

@ -116,7 +116,7 @@ class GestureControlView : LinearLayout {
_scaleGestureDetector = ScaleGestureDetector(context, object : ScaleGestureDetector.SimpleOnScaleGestureListener() {
override fun onScale(detector: ScaleGestureDetector): Boolean {
if (!_isFullScreen) {
if (!_isFullScreen || !Settings.instance.gestureControls.zoom) {
return false
}
@ -201,7 +201,7 @@ class GestureControlView : LinearLayout {
}
}
}
} else if (_isFullScreen && !_isZooming) {
} else if (_isFullScreen && !_isZooming && Settings.instance.gestureControls.pan) {
stopAllGestures()
pan(_translationX - distanceX, _translationY - distanceY)
}

View file

@ -355,6 +355,10 @@
<string name="system_brightness_descr">Gesture controls adjust system brightness</string>
<string name="restore_system_brightness">Restore system brightness</string>
<string name="restore_system_brightness_descr">Restore system brightness when exiting fullscreen</string>
<string name="zoom_option">Enable zoom</string>
<string name="zoom_option_descr">Enable two finger pinch zoom gesture</string>
<string name="pan_option">Enable pan</string>
<string name="pan_option_descr">Enable two finger pan gesture</string>
<string name="system_volume">System volume</string>
<string name="system_volume_descr">Gesture controls adjust system volume</string>
<string name="live_chat_webview">Live Chat Webview</string>