Могу быть немного не в контексте, но нету опции хранить и работать с просто duration условным и уже в визуальном представлении разбивать на минуты и секунды?
Неандроидный пример на коленке:
@ExperimentalTime
suspend fun main() {
var timerCountdown = 1.minutes + 20.seconds
val interval = 1.seconds
while (timerCountdown != Duration.ZERO) {
println(timerCountdown.toMinutesAndSeconds())
delay(interval)
timerCountdown -= interval
}
}
@ExperimentalTime
fun Duration.toMinutesAndSeconds(): String = toComponents { minutes, seconds, _ ->
val secondsFormatted = "%02d".format(seconds)
"$minutes:$secondsFormatted"
}
@ExperimentalTime
suspend fun delay(duration: Duration) = delay(duration.toLongMilliseconds())