CarNavigationTemplates

Builds the templates of the Mapbox navigation screen. The builders have no state and no side effects, so apps with their own screens can use them to show the same templates.

Functions

Link copied to clipboard
fun activeGuidance(navigationInfo: CarNavigationInfo, actionStrip: ActionStrip, mapActionStrip: ActionStrip): NavigationTemplate

Builds the active guidance NavigationTemplate used by the Mapbox navigation screen.

Link copied to clipboard
fun freeDrive(actionStrip: ActionStrip, mapActionStrip: ActionStrip): NavigationTemplate

Builds the free drive NavigationTemplate used by the Mapbox navigation screen.

Link copied to clipboard
fun routePreview(routesPreview: RoutesPreview, title: CharSequence, navigateActionTitle: CharSequence, formatDistance: (Double) -> CharSequence, onRouteSelected: (routeId: String) -> Unit, onNavigate: (routeId: String) -> Unit, navigateActionIcon: CarIcon? = null): ListTemplate

Builds the route preview list used as the content of a androidx.car.app.navigation.model.MapWithContentTemplate by the Mapbox navigation screen. Every row shows the duration, summary and distance of a route and has a navigate action. An empty RoutesPreview.originalRoutesList shows a loading list.