feat: ETA
This commit is contained in:
parent
028f1b6082
commit
c329cffeb7
5 changed files with 77 additions and 6 deletions
|
@ -2,6 +2,7 @@ package eu.ztsh.garmin.data
|
|||
|
||||
import com.mapbox.navigation.tripdata.maneuver.model.Maneuver
|
||||
import com.mapbox.navigation.core.trip.session.LocationMatcherResult
|
||||
import com.mapbox.navigation.tripdata.progress.model.TripProgressUpdateValue
|
||||
|
||||
class MapboxMapper {
|
||||
|
||||
|
@ -111,6 +112,13 @@ class MapboxMapper {
|
|||
|
||||
}
|
||||
|
||||
fun asEta(trip: TripProgressUpdateValue): Arrival {
|
||||
val eta = trip.formatter
|
||||
.getEstimatedTimeToArrival(trip.estimatedTimeToArrival)
|
||||
.toString().split(":")
|
||||
return Arrival(eta[0].toInt(), eta[1].toInt())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue