[Android] Streams: Add 'append' option in context menu
Geoffrey Métais
git at videolan.org
Fri Mar 8 16:41:37 CET 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar 8 16:41:09 2019 +0100| [c996ed51e2e5cc7f15ed85518462ffbabeb2fa01] | committer: Geoffrey Métais
Streams: Add 'append' option in context menu
Fix #762
> https://code.videolan.org/videolan/vlc-android/commit/c996ed51e2e5cc7f15ed85518462ffbabeb2fa01
---
vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt
index 63357dd1f..82336d42d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/network/MRLPanelFragment.kt
@@ -50,6 +50,7 @@ import org.videolan.vlc.gui.dialogs.showContext
import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.media.MediaUtils
import org.videolan.vlc.util.CTX_ADD_TO_PLAYLIST
+import org.videolan.vlc.util.CTX_APPEND
import org.videolan.vlc.util.CTX_RENAME
import org.videolan.vlc.viewmodels.StreamsModel
@@ -132,7 +133,7 @@ class MRLPanelFragment : DialogFragment(), View.OnKeyListener, TextView.OnEditor
}
private fun showContext(position: Int) {
- val flags = CTX_RENAME or CTX_ADD_TO_PLAYLIST
+ val flags = CTX_RENAME or CTX_APPEND or CTX_ADD_TO_PLAYLIST
val media = viewModel.observableHistory.value?.get(position) ?: return
showContext(requireActivity(), this, position, media.title, flags)
}
@@ -140,6 +141,10 @@ class MRLPanelFragment : DialogFragment(), View.OnKeyListener, TextView.OnEditor
override fun onCtxAction(position: Int, option: Int) {
when (option) {
CTX_RENAME -> renameStream(position)
+ CTX_APPEND -> {
+ val media = viewModel.observableHistory.value?.get(position) ?: return
+ MediaUtils.appendMedia(requireContext(), media)
+ }
CTX_ADD_TO_PLAYLIST -> {
val media = viewModel.observableHistory.value?.get(position) ?: return
UiTools.addToPlaylist(requireActivity(), media.tracks, SavePlaylistDialog.KEY_NEW_TRACKS)
More information about the Android
mailing list