[Android] Fix player double tap areas

Nicolas Pomepuy git at videolan.org
Thu Jul 2 11:51:03 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Jul  2 07:12:06 2020 +0200| [c02de2f4ae602cfd4fdcb5abe176135bd38b66cd] | committer: Nicolas Pomepuy

Fix player double tap areas

Fixes #1393

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

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

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 3363bd869..69f1bdd62 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -493,7 +493,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
         windowManager.defaultDisplay.getMetrics(dm)
         val yRange = dm.widthPixels.coerceAtMost(dm.heightPixels)
         val xRange = dm.widthPixels.coerceAtLeast(dm.heightPixels)
-        val sc = ScreenConfig(dm, xRange, yRange, orientationMode.orientation)
+        val sc = ScreenConfig(dm, xRange, yRange, resources.configuration.orientation)
         touchDelegate = VideoTouchDelegate(this, touch, sc, isTv)
         UiTools.setRotationAnimation(this)
         if (savedInstanceState != null) {
@@ -680,7 +680,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
             val sc = ScreenConfig(dm,
                     dm.widthPixels.coerceAtLeast(dm.heightPixels),
                     dm.widthPixels.coerceAtMost(dm.heightPixels),
-                    orientationMode.orientation)
+                    newConfig.orientation)
             touchDelegate.screenConfig = sc
         }
         resetHudLayout()
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 76bac169e..880e378cd 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
@@ -232,6 +232,7 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
                                 player.doPlayPause()
                             } else {
                                 val range = (if (screenConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) screenConfig.xRange else screenConfig.yRange).toFloat()
+                                if (BuildConfig.DEBUG) Log.d("VideoTouchDelegate", "Landscape: ${screenConfig.orientation == Configuration.ORIENTATION_LANDSCAPE} range: $range eventx: ${event.x}")
                                 when {
                                     event.x < range / 4f -> seekDelta(-10000)
                                     event.x > range * 0.75 -> seekDelta(10000)



More information about the Android mailing list