[Android] Hide play queue time indicator when playing one track

Nicolas Pomepuy git at videolan.org
Fri Feb 5 10:07:18 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Feb  2 09:59:27 2021 +0100| [f14dfa14bf260aff0edb995656429fc414d54234] | committer: Nicolas Pomepuy

Hide play queue time indicator when playing one track

Fixes #1610

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

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

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 147d9474b..52c280b46 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
@@ -314,6 +314,10 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
         lifecycleScope.launchWhenStarted {
             val text = withContext(Dispatchers.Default) {
                 val medias = playlistModel.medias ?: return at withContext ""
+                if (medias.size < 2) {
+                    withContext(Dispatchers.Main) { binding.audioPlayProgress.setGone() }
+                    return at withContext ""
+                } else withContext(Dispatchers.Main) { binding.audioPlayProgress.setVisible() }
                 if (playlistModel.currentMediaPosition == -1) return at withContext ""
                 val elapsedTracksTime = playlistModel.previousTotalTime ?: return at withContext ""
                 val totalTime = elapsedTracksTime + progress.time



More information about the Android mailing list