[Android] Allow adding a video group to another one in the ctx menu

Nicolas Pomepuy git at videolan.org
Mon Nov 23 13:36:45 CET 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Nov 13 11:27:35 2020 +0100| [fd25bfc8b8cf92db44ea412274895ff32bbc22d9] | committer: Nicolas Pomepuy

Allow adding a video group to another one in the ctx menu

Fixes #1542

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

 .../vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index 54100f619..af441fd48 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -459,6 +459,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
                 CTX_RENAME_GROUP -> renameGroup(media)
                 CTX_UNGROUP -> viewModel.ungroup(media)
                 CTX_MARK_ALL_AS_PLAYED -> lifecycleScope.launch { viewModel.markAsPlayed(media) }
+                CTX_ADD_GROUP -> requireActivity().addToGroup(listOf(media).getAll(), true) {}
             }
         }
     }
@@ -495,7 +496,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
             is VideoCtxClick -> {
                 when (item) {
                     is Folder -> showContext(requireActivity(), this at VideoGridFragment, position, item.title, CTX_FOLDER_FLAGS)
-                    is VideoGroup -> showContext(requireActivity(), this at VideoGridFragment, position, item.title, CTX_FOLDER_FLAGS or CTX_RENAME_GROUP or CTX_UNGROUP or CTX_PLAY_ALL and CTX_PLAY.inv())
+                    is VideoGroup -> showContext(requireActivity(), this at VideoGridFragment, position, item.title, CTX_FOLDER_FLAGS or CTX_RENAME_GROUP or CTX_UNGROUP or CTX_PLAY_ALL and CTX_PLAY.inv() or CTX_ADD_GROUP)
                     is MediaWrapper -> {
                         val group = item.type == MediaWrapper.TYPE_GROUP
                         var flags = if (group) CTX_VIDEO_GROUP_FLAGS else CTX_VIDEO_FLAGS



More information about the Android mailing list