Class CarNavigationTemplate
A turn-by-turn navigation surface: a drawable map (via a CarSurfaceCallback), an optional
next-manoeuvre / arrival info strip, and map-control action strips. Maps to
androidx.car.app.navigation.model.NavigationTemplate and CPMapTemplate.
Navigation is the only category with a pixel surface and it is the most tightly gated: the app
must declare the navigation category and hold the platform navigation entitlement
(ios.carplay.navigation build hint on iOS; the builder injects the
androidx.car.app.category.NAVIGATION filter and androidx.car.app.MAP_TEMPLATES permission on
Android).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the remaining-distance string, or null.Returns the header action strip, or null.Returns the map-control action strip (zoom, recenter), or null.Returns the next-manoeuvre instruction text, or null.Returns the map drawing callback, or null.Returns the remaining-time / ETA string, or null.booleanReturns true when turn-by-turn guidance is active (the info strip is shown).setDistanceRemaining(String distanceRemaining) Sets the remaining-distance string (e.g. "300 m").setHeaderActions(CarActionStrip headerActions) Sets the header action strip.setMapActions(CarActionStrip mapActions) Sets the map-control action strip (zoom in/out, recenter).setNavigating(boolean navigating) Marks whether guidance is active; when true the head unit shows the manoeuvre/ETA strip.setNextManeuver(String nextManeuver) Sets the next-manoeuvre instruction (e.g. "Turn right onto Main St").setSurfaceCallback(CarSurfaceCallback surfaceCallback) Sets the callback that draws the moving map onto the head-unit surface.setTimeRemaining(String timeRemaining) Sets the remaining-time / ETA string (e.g. "12 min").Methods inherited from class CarTemplate
getTitle
-
Constructor Details
-
CarNavigationTemplate
public CarNavigationTemplate()
-
-
Method Details
-
getSurfaceCallback
Returns the map drawing callback, or null. -
setSurfaceCallback
Sets the callback that draws the moving map onto the head-unit surface.
Parameters
surfaceCallback: the drawing callback
Returns
this template, for chaining
-
getNextManeuver
Returns the next-manoeuvre instruction text, or null. -
setNextManeuver
Sets the next-manoeuvre instruction (e.g. "Turn right onto Main St").
Parameters
nextManeuver: the instruction text
Returns
this template, for chaining
-
getDistanceRemaining
Returns the remaining-distance string, or null. -
setDistanceRemaining
Sets the remaining-distance string (e.g. "300 m").
Parameters
distanceRemaining: the distance text
Returns
this template, for chaining
-
getTimeRemaining
Returns the remaining-time / ETA string, or null. -
setTimeRemaining
Sets the remaining-time / ETA string (e.g. "12 min").
Parameters
timeRemaining: the time text
Returns
this template, for chaining
-
getMapActions
Returns the map-control action strip (zoom, recenter), or null. -
setMapActions
Sets the map-control action strip (zoom in/out, recenter).
Parameters
mapActions: the action strip
Returns
this template, for chaining
-
getHeaderActions
Returns the header action strip, or null. -
setHeaderActions
Sets the header action strip.
Parameters
headerActions: the action strip
Returns
this template, for chaining
-