HorizonUpdatedListener
Interface to horizon update listeners. Used to receive horizon update events during navigation.
To listen to horizon updates while navigating, first implement this interface to create a listener, for example:
val horizonUpdatedListener = object : HorizonUpdatedListener {
override fun onSnapshotUpdated(options: HorizonOptions, snapshot: HorizonSnapshot) {
// add code here that handles the horizon snapshot update
}
override fun onPositionUpdated(options: HorizonOptions, position: HorizonPosition) {
// add code here that handles the horizon position update
}
}
Then, add the listener you created with the TomTomNavigation object for the set of horizon options for which you wish to receive an update. To do that, use addHorizonUpdatedListener:
tomTomNavigation.addHorizonUpdatedListener(horizonOptions, horizonUpdatedListener)
To stop listening to horizon updates, remove the listener using removeHorizonUpdatedListener:
tomTomNavigation.removeHorizonUpdatedListener(horizonUpdatedListener)
Functions
Called when a horizon reset has occurred for a specific set of horizon options. The horizon is reset following a map update, a vehicle profile update or a route update, or when the current input position does not belong to any of the existing horizon paths (for example, a jump to a new place).
Called when the horizon position has been updated for a specific set of horizon options.
Called when the horizon snapshot has been updated for a specific set of horizon options.