[Android] Fix double tap to seek when setting is disabled

Nicolas Pomepuy git at videolan.org
Wed Jun 5 16:08:51 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Jun  5 13:01:09 2019 +0200| [3f4e38c83ee7d4c19691e2f8b916329a8aeea2c9] | committer: Nicolas Pomepuy

Fix double tap to seek when setting is disabled

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

 .../src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt    | 13 +++++++------
 1 file changed, 7 insertions(+), 6 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 ff662ba3c..66ac0fa31 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -183,13 +183,14 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
                         if (numberOfTaps > 1 && !player.isLocked) {
                             if (mTouchControls and TOUCH_FLAG_SEEK == 0) {
                                 player.doPlayPause()
-                            }
-                            val range = (if (screenConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) screenConfig.xRange else screenConfig.yRange).toFloat()
+                            } else {
+                                val range = (if (screenConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) screenConfig.xRange else screenConfig.yRange).toFloat()
 
-                            when {
-                                event.rawX < range / 4f -> player.seekDelta(-10000)
-                                event.rawX > range * 0.75 -> player.seekDelta(10000)
-                                else -> player.doPlayPause()
+                                when {
+                                    event.rawX < range / 4f -> player.seekDelta(-10000)
+                                    event.rawX > range * 0.75 -> player.seekDelta(10000)
+                                    else -> player.doPlayPause()
+                                }
                             }
                         }
 



More information about the Android mailing list