Skip to content
Snippets Groups Projects
Commit f14dfa14 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Hide play queue time indicator when playing one track

Fixes #1610
parent 61ba4b69
No related branches found
No related tags found
1 merge request!892Play queue indicator improvements
......@@ -314,6 +314,10 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
lifecycleScope.launchWhenStarted {
val text = withContext(Dispatchers.Default) {
val medias = playlistModel.medias ?: return@withContext ""
if (medias.size < 2) {
withContext(Dispatchers.Main) { binding.audioPlayProgress.setGone() }
return@withContext ""
} else withContext(Dispatchers.Main) { binding.audioPlayProgress.setVisible() }
if (playlistModel.currentMediaPosition == -1) return@withContext ""
val elapsedTracksTime = playlistModel.previousTotalTime ?: return@withContext ""
val totalTime = elapsedTracksTime + progress.time
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment