prepend remaining time with a Minus sign at negative time
This commit is contained in:
parent
5878af2cc5
commit
5315c56661
|
@ -41,7 +41,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:3.15.10'
|
implementation 'com.simplemobiletools:commons:3.15.11'
|
||||||
implementation 'com.facebook.stetho:stetho:1.5.0'
|
implementation 'com.facebook.stetho:stetho:1.5.0'
|
||||||
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
|
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
|
||||||
implementation 'com.shawnlin:number-picker:2.4.6'
|
implementation 'com.shawnlin:number-picker:2.4.6'
|
||||||
|
|
|
@ -147,7 +147,16 @@ class TimerFragment : Fragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateDisplayedText() {
|
private fun updateDisplayedText() {
|
||||||
view.timer_time.text = (initialSecs - totalTicks).getFormattedDuration()
|
val diff = initialSecs - totalTicks
|
||||||
|
var formattedDuration = Math.abs(diff).getFormattedDuration()
|
||||||
|
if (diff < 0) {
|
||||||
|
formattedDuration = "-$formattedDuration"
|
||||||
|
}
|
||||||
|
|
||||||
|
view.timer_time.text = formattedDuration
|
||||||
|
if (diff == 0) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val updateRunnable = object : Runnable {
|
private val updateRunnable = object : Runnable {
|
||||||
|
|
Loading…
Reference in New Issue