[Android] Allow deleting videos in the main view, even when grouping is name of folder

Nicolas Pomepuy git at videolan.org
Thu Sep 22 14:01:22 UTC 2022


vlc-android | branch: 3.5.x | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Sep 22 14:21:15 2022 +0200| [39b4a5da8a24e48c6f993d533e45ab3b75641075] | committer: Duncan McNamara

Allow deleting videos in the main view, even when grouping is name of folder

Fixes #2690

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

 application/vlc-android/res/menu/action_mode_folder.xml              | 5 +++++
 application/vlc-android/res/menu/action_mode_video_group.xml         | 5 +++++
 .../vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt  | 2 ++
 3 files changed, 12 insertions(+)

diff --git a/application/vlc-android/res/menu/action_mode_folder.xml b/application/vlc-android/res/menu/action_mode_folder.xml
index 17aca63e2..9e49ecd4d 100644
--- a/application/vlc-android/res/menu/action_mode_folder.xml
+++ b/application/vlc-android/res/menu/action_mode_folder.xml
@@ -16,4 +16,9 @@
         android:title="@string/add_to_playlist"
             android:icon="@drawable/ic_am_addtoplaylist"
         app:showAsAction="always"/>
+    <item
+            android:id="@+id/action_video_delete"
+            android:title="@string/delete"
+            android:icon="@drawable/ic_am_trash"
+            app:showAsAction="ifRoom" />
 </menu>
\ No newline at end of file
diff --git a/application/vlc-android/res/menu/action_mode_video_group.xml b/application/vlc-android/res/menu/action_mode_video_group.xml
index 46f7ea211..ce14b0612 100644
--- a/application/vlc-android/res/menu/action_mode_video_group.xml
+++ b/application/vlc-android/res/menu/action_mode_video_group.xml
@@ -31,6 +31,11 @@
             android:title="@string/rename_group"
             android:icon="@drawable/ic_edit"
             app:showAsAction="ifRoom" />
+    <item
+            android:id="@+id/action_video_delete"
+            android:title="@string/delete"
+            android:icon="@drawable/ic_am_trash"
+            app:showAsAction="ifRoom" />
 
     <item
             android:id="@+id/action_group_similar"
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 42ff3376b..0802f4e94 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
@@ -409,6 +409,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
                     R.id.action_folder_play -> viewModel.playFoldersSelection(selection)
                     R.id.action_folder_append -> viewModel.appendFoldersSelection(selection)
                     R.id.action_folder_add_playlist -> lifecycleScope.launch { requireActivity().addToPlaylist(withContext(Dispatchers.Default) { selection.getAll() }) }
+                    R.id.action_video_delete -> removeItems(selection.getAll())
                     else -> return false
                 }
             }
@@ -423,6 +424,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
                     R.id.action_rename -> renameGroup(selection.first() as VideoGroup)
                     R.id.action_add_to_group -> addToGroup(selection)
                     R.id.action_mode_go_to_folder -> (selection.first() as? MediaWrapper)?.let { showParentFolder(it) }
+                    R.id.action_video_delete -> removeItems(selection.getAll())
                     else -> return false
                 }
             }



More information about the Android mailing list