[Android] Force selection when ctrl or shift is pressed

Nicolas Pomepuy git at videolan.org
Mon Oct 7 09:28:52 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Sep 30 13:20:15 2024 +0200| [96079041baf3d4d7c01b0c567da1907b492fd4c9] | committer: Nicolas Pomepuy

Force selection when ctrl or shift is pressed

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

 .../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt          | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index 4851ca31e9..8a9c68fcb9 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -82,6 +82,7 @@ import org.videolan.tools.BROWSER_SHOW_HIDDEN_FILES
 import org.videolan.tools.BROWSER_SHOW_ONLY_MULTIMEDIA
 import org.videolan.tools.FORCE_PLAY_ALL_AUDIO
 import org.videolan.tools.FORCE_PLAY_ALL_VIDEO
+import org.videolan.tools.KeyHelper
 import org.videolan.tools.MultiSelectHelper
 import org.videolan.tools.Settings
 import org.videolan.tools.dp
@@ -690,6 +691,10 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
     }
 
     override fun onClick(v: View, position: Int, item: MediaLibraryItem) {
+        if (KeyHelper.isShiftPressed || KeyHelper.isCtrlPressed) {
+            onLongClick(v, position, item)
+            return
+        }
         val mediaWrapper = item as MediaWrapper
         if (actionMode != null) {
             if (mediaWrapper.type == MediaWrapper.TYPE_AUDIO ||



More information about the Android mailing list