Package com.mapbox.navigation.core.lifecycle

Types

Link copied to clipboard
object MapboxNavigationApp

Manages a default lifecycle for MapboxNavigation.

Link copied to clipboard
interface MapboxNavigationObserver

Defines an object that needs to interact with or observe MapboxNavigation. Use the MapboxNavigationApp singleton to register and unregister observers with MapboxNavigationApp.registerObserver and MapboxNavigationApp.unregisterObserver.

Link copied to clipboard
fun interface NavigationOptionsProvider

Represents a function that returns NavigationOptions

Functions

Link copied to clipboard
fun forwardMapboxNavigation(attach: (MapboxNavigation) -> Unit, detach: (MapboxNavigation) -> Unit): MapboxNavigationObserver

This extension removes boilerplate from a class that needs to use MapboxNavigation, and it makes your class appear as if it implements MapboxNavigationObserver without exposing the functions.

Link copied to clipboard
fun LifecycleOwner.requireMapboxNavigation(    onCreatedObserver: MapboxNavigationObserver? = null,     onStartedObserver: MapboxNavigationObserver? = null,     onResumedObserver: MapboxNavigationObserver? = null,     onInitialize: () -> Unit? = null): ReadOnlyProperty<Any, MapboxNavigation>

Extension function to make it simple to create the RequireMapboxNavigationDelegate. Below are a couple examples of how you may use the delegate.