mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
fix #21, wrong time at stopwatch This lap
This commit is contained in:
@ -76,6 +76,17 @@ class StopwatchFragment : Fragment() {
|
|||||||
|
|
||||||
stopwatch_lap.setOnClickListener {
|
stopwatch_lap.setOnClickListener {
|
||||||
stopwatch_sorting_indicators_holder.beVisible()
|
stopwatch_sorting_indicators_holder.beVisible()
|
||||||
|
if (laps.isEmpty()) {
|
||||||
|
val lap = Lap(currentLap++, lapTicks * UPDATE_INTERVAL, totalTicks * UPDATE_INTERVAL)
|
||||||
|
laps.add(0, lap)
|
||||||
|
lapTicks = 0
|
||||||
|
} else {
|
||||||
|
laps.first().apply {
|
||||||
|
lapTime = lapTicks * UPDATE_INTERVAL
|
||||||
|
totalTime = totalTicks * UPDATE_INTERVAL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val lap = Lap(currentLap++, lapTicks * UPDATE_INTERVAL, totalTicks * UPDATE_INTERVAL)
|
val lap = Lap(currentLap++, lapTicks * UPDATE_INTERVAL, totalTicks * UPDATE_INTERVAL)
|
||||||
laps.add(0, lap)
|
laps.add(0, lap)
|
||||||
lapTicks = 0
|
lapTicks = 0
|
||||||
|
Reference in New Issue
Block a user