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

Link copied to clipboard
abstract fun onPositionUpdated(options: HorizonOptions, position: HorizonPosition)

Called when the horizon position has been updated for a specific set of horizon options.

Link copied to clipboard
abstract fun onSnapshotUpdated(options: HorizonOptions, snapshot: HorizonSnapshot)

Called when the horizon snapshot has been updated for a specific set of horizon options.