From fd6dd597561e36060d4460e1a0672a2475b50a72 Mon Sep 17 00:00:00 2001 From: Kyle Corry Date: Fri, 7 Jan 2022 12:01:28 -0500 Subject: [PATCH] Fix desugaring --- .../java/com/kylecorry/trail_sense/shared/FormatService.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/kylecorry/trail_sense/shared/FormatService.kt b/app/src/main/java/com/kylecorry/trail_sense/shared/FormatService.kt index 828a01827..bd69e7cb0 100644 --- a/app/src/main/java/com/kylecorry/trail_sense/shared/FormatService.kt +++ b/app/src/main/java/com/kylecorry/trail_sense/shared/FormatService.kt @@ -276,8 +276,8 @@ class FormatService(private val context: Context) { includeSeconds: Boolean = false ): String { val hours = duration.toHours() - val minutes = duration.toMinutesPart() - val seconds = duration.toSecondsPart() + val minutes = duration.toMinutes() % 60 + val seconds = duration.seconds % 60 val h = context.getString(R.string.duration_hour_format, hours) val m = context.getString(R.string.duration_minute_format, minutes) @@ -293,7 +293,7 @@ class FormatService(private val context: Context) { strs.add(m) } - if (seconds > 0 && includeSeconds && (!short || (hours == 0L && minutes == 0))) { + if (seconds > 0 && includeSeconds && (!short || (hours == 0L && minutes == 0L))) { strs.add(s) }