mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Do not append 0 values when formatting duration
This commit is contained in:
parent
c432985cb4
commit
8b628229ed
@ -93,16 +93,22 @@ object TextUtils {
|
|||||||
when {
|
when {
|
||||||
hours > 0 -> {
|
hours > 0 -> {
|
||||||
appendHours(context, builder, hours)
|
appendHours(context, builder, hours)
|
||||||
|
if(minutes > 0) {
|
||||||
builder.append(" ")
|
builder.append(" ")
|
||||||
appendMinutes(context, builder, minutes)
|
appendMinutes(context, builder, minutes)
|
||||||
|
}
|
||||||
|
if(seconds > 0) {
|
||||||
builder.append(" ")
|
builder.append(" ")
|
||||||
appendSeconds(context, builder, seconds)
|
appendSeconds(context, builder, seconds)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
minutes > 0 -> {
|
minutes > 0 -> {
|
||||||
appendMinutes(context, builder, minutes)
|
appendMinutes(context, builder, minutes)
|
||||||
|
if(seconds > 0) {
|
||||||
builder.append(" ")
|
builder.append(" ")
|
||||||
appendSeconds(context, builder, seconds)
|
appendSeconds(context, builder, seconds)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
appendSeconds(context, builder, seconds)
|
appendSeconds(context, builder, seconds)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user