Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed37968b authored by tibbi's avatar tibbi
Browse files

simplify second formatting to duration

parent 58fa3485
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.15.10'
        propVersionName = '3.15.11'
        kotlin_version = '1.2.30'
        support_libs = '27.1.0'
    }
+3 −3
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@ fun Int.adjustAlpha(factor: Float): Int {

fun Int.getFormattedDuration(): String {
    val sb = StringBuilder(8)
    val hours = this / (60 * 60)
    val minutes = this % (60 * 60) / 60
    val seconds = this % (60 * 60) % 60
    val hours = this / 3600
    val minutes = this % 3600 / 60
    val seconds = this % 60

    if (this > 3600) {
        sb.append(String.format(Locale.getDefault(), "%02d", hours)).append(":")