[Android] Update progress and subtitle information.
Robert Stone
git at videolan.org
Tue Dec 1 13:11:24 CET 2020
vlc-android | branch: master | Robert Stone <rhstone at gmail.com> | Sun Nov 29 21:18:53 2020 -0800| [5f407746faeed4a34660da8be55cd0bf45e45410] | committer: Nicolas Pomepuy
Update progress and subtitle information.
Use bullet as separator with consistent padding. Only show divider if total time is available, and display "0s" if there is no progress to report.
> https://code.videolan.org/videolan/vlc-android/commit/5f407746faeed4a34660da8be55cd0bf45e45410
---
.../vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.kt | 8 +++++---
.../src/org/videolan/vlc/gui/video/VideoListAdapter.kt | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
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 879e00284..560fbb693 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
@@ -313,11 +313,13 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher, IAudioPlay
if (playlistModel.currentMediaPosition == -1) return at withContext ""
val elapsedTracksTime = playlistModel.previousTotalTime ?: return at withContext ""
val totalTime = elapsedTracksTime + progress.time
- val currentProgressText = if (totalTime == 0L) "0s" else Tools.millisToString(totalTime, true, false, false)
+ val totalTimeText = Tools.millisToString(totalTime, true, false, false)
+ val currentProgressText = if (totalTimeText.isNullOrEmpty()) "0s" else totalTimeText
val textTrack = getString(R.string.track_index, "${playlistModel.currentMediaPosition + 1} / ${medias.size}")
- val textProgress = getString(R.string.audio_queue_progress, "$currentProgressText / ${playlistModel.totalTime}")
- "$textTrack • $textProgress"
+ val textProgress = getString(R.string.audio_queue_progress,
+ if (playlistModel.totalTime.isNullOrEmpty()) "$currentProgressText" else "$currentProgressText / ${playlistModel.totalTime}")
+ "$textTrack • $textProgress"
}
binding.audioPlayProgress.text = text
}
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
index 4c818b434..1b65ad23a 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.kt
@@ -169,7 +169,7 @@ class VideoListAdapter(private var isSeenMediaMarkerVisible: Boolean
progress = (lastTime / 1000).toInt()
}
if (isListMode && resolution !== null) {
- "${Tools.millisToText(item.length)} | $resolution"
+ "${Tools.millisToText(item.length)} • $resolution"
} else Tools.millisToText(item.length)
} else null
}
More information about the Android
mailing list