[Android] Remove double tap delay when double tap actions disabled

Andrew Churilo git at videolan.org
Tue May 17 11:42:11 UTC 2022


vlc-android | branch: master | Andrew Churilo <AndrewChuriloMinsk at gmail.com> | Tue May 17 12:35:26 2022 +0300| [ce0ddc08bcc7a9ded4ec09c8b72b691795170d05] | committer: Andrew Churilo

Remove double tap delay when double tap actions disabled

Fixes #2527

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

 .../src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt       | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 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 a8ba2b036..892b2ca0c 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
@@ -244,11 +244,17 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
                             }
                         }
 
-                        handler.postDelayed({
+                        val showHideUIRunnable = Runnable {
                             when (numberOfTaps) {
                                 1 -> player.handler.sendEmptyMessage(if (player.isShowing) VideoPlayerActivity.HIDE_INFO else VideoPlayerActivity.SHOW_INFO)
                             }
-                        }, ViewConfiguration.getDoubleTapTimeout().toLong())
+                        }
+
+                        if (touchControls and (TOUCH_FLAG_PLAY or TOUCH_FLAG_DOUBLE_TAP_SEEK) != 0) {
+                            handler.postDelayed(showHideUIRunnable, ViewConfiguration.getDoubleTapTimeout().toLong())
+                        } else {
+                            showHideUIRunnable.run()
+                        }
                     }
                 }
                 return touchAction != TOUCH_NONE



More information about the Android mailing list