feat: ETA

This commit is contained in:
Piotr Dec 2024-08-02 23:28:56 +02:00
parent 028f1b6082
commit c329cffeb7
Signed by: stawros
GPG key ID: F89F27AD8F881A91
5 changed files with 77 additions and 6 deletions

View file

@ -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