[Android] video player: disable scale gestures if locked

Sébastien Toque git at videolan.org
Tue Sep 25 00:13:52 CEST 2018


vlc-android | branch: master | Sébastien Toque <xilasz at gmail.com> | Mon Sep 24 23:47:19 2018 +0200| [ed78327c965c06c2b79c4bdb0eea5536fe129a2f] | committer: Sébastien Toque

video player: disable scale gestures if locked

> https://code.videolan.org/videolan/vlc-android/commit/ed78327c965c06c2b79c4bdb0eea5536fe129a2f
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
index e38d8781f..93f4352e3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -281,7 +281,7 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
         }
 
         override fun onScale(detector: ScaleGestureDetector): Boolean {
-            if (player.fov != 0f) {
+            if (player.fov != 0f && !player.isLocked) {
                 val diff = VideoPlayerActivity.DEFAULT_FOV * (1 - detector.scaleFactor)
                 if (player.updateViewpoint(0f, 0f, diff)) {
                     player.fov = Math.min(Math.max(MIN_FOV, player.fov + diff), MAX_FOV)
@@ -292,7 +292,7 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
         }
 
         override fun onScaleEnd(detector: ScaleGestureDetector) {
-            if (player.fov == 0f) {
+            if (player.fov == 0f && !player.isLocked) {
                 val grow = detector.scaleFactor > 1.0f
                 if (grow && player.currentSize != VideoPlayerActivity.SURFACE_FIT_SCREEN) {
                     savedSize = player.currentSize



More information about the Android mailing list