[Android] Exit touch action after performing seek
Geoffrey Métais
git at videolan.org
Mon Feb 10 13:31:06 CET 2020
vlc-android | branch: master | Geoffrey Métais <geoffrey at videolan.org> | Mon Feb 10 13:31:06 2020 +0100| [7c1c9a805f606ec012a82193c29137b67662f3d5] | committer: Nicolas Pomepuy
Exit touch action after performing seek
Fix #1175
> https://code.videolan.org/videolan/vlc-android/commit/7c1c9a805f606ec012a82193c29137b67662f3d5
---
.../src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
index 27d6b0d17..76bac169e 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -194,10 +194,18 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
if (touchAction == TOUCH_IGNORE) touchAction = TOUCH_NONE
// Mouse events for the core
player.sendMouseEvent(MotionEvent.ACTION_UP, xTouch, yTouch)
- // Seek
- if (touchAction == TOUCH_SEEK) doSeekTouch(deltaY.roundToInt(), xgesturesize, true)
touchX = -1f
touchY = -1f
+ // Seek
+ if (touchAction == TOUCH_SEEK) {
+ doSeekTouch(deltaY.roundToInt(), xgesturesize, true)
+ return true
+ }
+ // Vertical actions
+ if (touchAction == TOUCH_VOLUME || touchAction == TOUCH_BRIGHTNESS) {
+ doVerticalTouchAction(yChanged)
+ return true
+ }
handler.removeCallbacksAndMessages(null)
@@ -224,7 +232,6 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
player.doPlayPause()
} else {
val range = (if (screenConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) screenConfig.xRange else screenConfig.yRange).toFloat()
-
when {
event.x < range / 4f -> seekDelta(-10000)
event.x > range * 0.75 -> seekDelta(10000)
More information about the Android
mailing list