[Android] Add Insert next to video card context menu

Nicolas Pomepuy git at videolan.org
Wed Jul 24 15:18:23 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Mon Jul 22 14:45:30 2019 +0200| [285fd7d9655d112da48b7e3a970f5b720d878798] | committer: Geoffrey Métais

Add Insert next to video card context menu

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

 vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt        | 2 +-
 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt | 1 +
 vlc-android/src/org/videolan/vlc/util/Constants.kt              | 5 +++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt b/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
index 63d53b9c9..cde13956d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
@@ -269,7 +269,7 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler, IL
         val list = audioBrowserAdapter.multiSelectHelper.getSelection()
         val tracks = ArrayList<AbstractMediaWrapper>()
         for (mediaItem in list)
-            tracks.addAll(Arrays.asList(*mediaItem.tracks))
+            tracks.addAll(listOf(*mediaItem.tracks))
 
         if (item.itemId == R.id.action_mode_audio_playlist_up) {
             Toast.makeText(this, "UP !", Toast.LENGTH_SHORT).show()
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index 6e8022bf7..0da1d2cfb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -373,6 +373,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
             CTX_INFORMATION -> showInfoDialog(media)
             CTX_DELETE -> removeItem(media)
             CTX_APPEND -> MediaUtils.appendMedia(activity, media)
+            CTX_PLAY_NEXT -> MediaUtils.insertNext(requireActivity(), media.tracks)
             CTX_DOWNLOAD_SUBTITLES -> MediaUtils.getSubs(requireActivity(), media)
             CTX_ADD_TO_PLAYLIST -> UiTools.addToPlaylist(requireActivity(), media.tracks, SavePlaylistDialog.KEY_NEW_TRACKS)
         }
diff --git a/vlc-android/src/org/videolan/vlc/util/Constants.kt b/vlc-android/src/org/videolan/vlc/util/Constants.kt
index 2cb77c786..d39c7d1cb 100644
--- a/vlc-android/src/org/videolan/vlc/util/Constants.kt
+++ b/vlc-android/src/org/videolan/vlc/util/Constants.kt
@@ -45,7 +45,8 @@ const val ACTIVITY_RESULT_OPEN = 2
 const val ACTIVITY_RESULT_SECONDARY = 3
 
 // PlaybackService
- at JvmField val ACTION_REMOTE_GENERIC = "remote.".buildPkgString()!!
+ at JvmField
+val ACTION_REMOTE_GENERIC = "remote.".buildPkgString()
 @JvmField val EXTRA_SEARCH_BUNDLE = "${ACTION_REMOTE_GENERIC}extra_search_bundle"
 @JvmField val ACTION_PLAY_FROM_SEARCH = "${ACTION_REMOTE_GENERIC}play_from_search"
 @JvmField val ACTION_REMOTE_SWITCH_VIDEO = "${ACTION_REMOTE_GENERIC}SwitchToVideo"
@@ -163,7 +164,7 @@ const val CTX_PICK_SUBS = 1 shl 22
 const val CTX_VIDEO_TRACK = 1 shl 23
 const val CTX_DOWNLOAD_SUBTITLES_PLAYER = 1 shl 24
 
-const val CTX_VIDEO_FLAGS = CTX_APPEND or CTX_DELETE or CTX_DOWNLOAD_SUBTITLES or CTX_INFORMATION or CTX_PLAY_ALL or CTX_PLAY_AS_AUDIO or CTX_ADD_TO_PLAYLIST
+const val CTX_VIDEO_FLAGS = CTX_APPEND or CTX_PLAY_NEXT or CTX_DELETE or CTX_DOWNLOAD_SUBTITLES or CTX_INFORMATION or CTX_PLAY_ALL or CTX_PLAY_AS_AUDIO or CTX_ADD_TO_PLAYLIST
 const val CTX_TRACK_FLAGS = CTX_APPEND or CTX_PLAY_NEXT or CTX_DELETE or CTX_INFORMATION or CTX_PLAY_ALL or CTX_ADD_TO_PLAYLIST or CTX_SET_RINGTONE
 const val CTX_AUDIO_FLAGS = CTX_PLAY or CTX_APPEND or CTX_PLAY_NEXT or CTX_ADD_TO_PLAYLIST
 const val CTX_PLAYLIST_FLAGS = CTX_AUDIO_FLAGS or CTX_DELETE



More information about the Android mailing list