diff --git a/app/src/main/java/com/futo/platformplayer/Settings.kt b/app/src/main/java/com/futo/platformplayer/Settings.kt index 168cddfb..c99e14d0 100644 --- a/app/src/main/java/com/futo/platformplayer/Settings.kt +++ b/app/src/main/java/com/futo/platformplayer/Settings.kt @@ -809,7 +809,27 @@ class Settings : FragmentedStorageFileJson() { var polycentricEnabled: Boolean = true; } - @FormField(R.string.info, FieldForm.GROUP, -1, 19) + @FormField(R.string.gesture_controls, FieldForm.GROUP, -1, 19) + var gestureControls = GestureControls(); + @Serializable + class GestureControls { + @FormField(R.string.volume_slider, FieldForm.TOGGLE, -1, 1) + var volumeSlider: Boolean = true; + + @FormField(R.string.brightness_slider, FieldForm.TOGGLE, -1, 2) + var brightnessSlider: Boolean = true; + + @FormField(R.string.toggle_full_screen, FieldForm.TOGGLE, -1, 3) + var toggleFullscreen: Boolean = true; + + @FormField(R.string.system_brightness, FieldForm.TOGGLE, -1, 4) + var useSystemBrightness: Boolean = false; + + @FormField(R.string.system_brightness, FieldForm.TOGGLE, -1, 4) + var useSystemVolume: Boolean = false; + } + + @FormField(R.string.info, FieldForm.GROUP, -1, 20) var info = Info(); @Serializable class Info { diff --git a/app/src/main/java/com/futo/platformplayer/views/behavior/GestureControlView.kt b/app/src/main/java/com/futo/platformplayer/views/behavior/GestureControlView.kt index f500a87e..1d0f258e 100644 --- a/app/src/main/java/com/futo/platformplayer/views/behavior/GestureControlView.kt +++ b/app/src/main/java/com/futo/platformplayer/views/behavior/GestureControlView.kt @@ -19,6 +19,7 @@ import androidx.core.animation.doOnEnd import androidx.core.animation.doOnStart import androidx.core.view.GestureDetectorCompat import com.futo.platformplayer.R +import com.futo.platformplayer.Settings import com.futo.platformplayer.constructs.Event0 import com.futo.platformplayer.constructs.Event1 import com.futo.platformplayer.logging.Logger @@ -126,11 +127,11 @@ class GestureControlView : LinearLayout { val rx = (p0.x + p1.x) / (2 * width); val ry = (p0.y + p1.y) / (2 * height); if (ry > 0.1 && ry < 0.9) { - if (_isFullScreen && rx < 0.2) { + if (Settings.instance.gestureControls.brightnessSlider && _isFullScreen && rx < 0.2) { startAdjustingBrightness(); - } else if (_isFullScreen && rx > 0.8) { + } else if (Settings.instance.gestureControls.volumeSlider && _isFullScreen && rx > 0.8) { startAdjustingSound(); - } else if (fullScreenGestureEnabled && rx in 0.3..0.7) { + } else if (Settings.instance.gestureControls.toggleFullscreen && fullScreenGestureEnabled && rx in 0.3..0.7) { if (_isFullScreen) { startAdjustingFullscreenDown(); } else { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d4f1b6d1..12775179 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -344,6 +344,12 @@ Get answers to common questions Give feedback on the application Info + Gesture controls + Volume slider + Brightness slider + Toogle full screen + System brightness + System volume Live Chat Webview Fullscreen portrait Allow fullscreen portrait