[Android] Apply the new "stop after this" behavior to the audio player

Nicolas Pomepuy git at videolan.org
Fri Oct 20 12:01:31 UTC 2023


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Oct 10 09:44:22 2023 +0200| [f48e0d8c4994be0355c9b26021984e659c1b954d] | committer: Duncan McNamara

Apply the new "stop after this" behavior to the audio player

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

 .../vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
index 691b34374f..886811d798 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt
@@ -336,7 +336,11 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
                     }
                     playlistModel.remove(position)
                 }
-                CTX_STOP_AFTER_THIS -> playlistModel.stopAfter(position)
+                CTX_STOP_AFTER_THIS -> {
+                    val pos = if (playlistModel.service?.playlistManager?.stopAfter != position) position else -1
+                    playlistModel.stopAfter(pos)
+                    playlistAdapter.stopAfter = pos
+                }
                 CTX_INFORMATION -> showInfoDialog(playlistAdapter.getItem(position))
                 CTX_GO_TO_FOLDER -> showParentFolder(playlistAdapter.getItem(position))
                 CTX_SHARE -> lifecycleScope.launch { (requireActivity() as AppCompatActivity).share(playlistAdapter.getItem(position)) }



More information about the Android mailing list