오디션 지원자

- 오디오 재생시 시간과 ProgressBar 추가
This commit is contained in:
2025-01-03 19:47:10 +09:00
parent 679e9ed349
commit 931a9433f3
6 changed files with 190 additions and 23 deletions

View File

@@ -1,13 +1,17 @@
package kr.co.vividnext.sodalive.common
object Utils {
fun convertDurationToString(duration: Int): String {
fun convertDurationToString(duration: Int, showHours: Boolean = true): String {
val durationSeconds = duration / 1000
val hours = (durationSeconds / 3600)
val minutes = ((durationSeconds % 3600) / 60)
val minutes = if (showHours) (durationSeconds % 3600) / 60 else durationSeconds / 60
val seconds = (durationSeconds % 60)
return "%02d:%02d:%02d".format(hours, minutes, seconds)
return if (showHours) {
"%02d:%02d:%02d".format(hours, minutes, seconds)
} else {
"%02d:%02d".format(minutes, seconds)
}
}
fun convertStringToDuration(timeString: String): Long {