Refresh Distance in PlaceList
This commit is contained in:
@@ -28,6 +28,7 @@ import kotlin.math.cos
|
||||
import kotlin.math.ln
|
||||
import kotlin.math.pow
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.ranges.contains
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
@@ -145,7 +146,7 @@ fun duration(
|
||||
2.seconds
|
||||
} else {
|
||||
val updateDuration = java.time.Duration.between(LocalDateTime.now(), lastLocationUpdate)
|
||||
if (updateDuration.toMillis().absoluteValue < 1000) {
|
||||
if (updateDuration.toMillis().absoluteValue !in 1000..2000) {
|
||||
2.seconds
|
||||
} else {
|
||||
((updateDuration!!.toMillis().absoluteValue * 1.8).toDuration(DurationUnit.MILLISECONDS))
|
||||
|
||||
Reference in New Issue
Block a user