feat: ETA
This commit is contained in:
parent
028f1b6082
commit
c329cffeb7
5 changed files with 77 additions and 6 deletions
|
@ -12,6 +12,7 @@ class DataCache {
|
|||
private var maneuverCache: Maneuver? = null
|
||||
private var locationCache: LocationMatcherResult? = null
|
||||
private var session: NavigationSessionState? = null
|
||||
private var eta: Arrival? = null
|
||||
|
||||
// maneuver
|
||||
fun hasChanged(guidance: Lane?): Boolean {
|
||||
|
@ -30,6 +31,15 @@ class DataCache {
|
|||
maneuverCache = maneuver
|
||||
}
|
||||
|
||||
// eta
|
||||
fun hasChanged(eta: Arrival): Boolean {
|
||||
return this.eta.let { it == null || it != eta }
|
||||
}
|
||||
|
||||
fun update(eta: Arrival) {
|
||||
this.eta = eta
|
||||
}
|
||||
|
||||
// location
|
||||
fun hasChanged(locationMatcherResult: LocationMatcherResult): Boolean {
|
||||
return locationCache == null || locationCache!! != locationMatcherResult
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue