public final class

NavigationTemplate.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.navigation.model.NavigationTemplate.Builder

Overview

A builder of NavigationTemplate.

Summary

Constructors
publicBuilder()

Constructs an empty NavigationTemplate.Builder instance.

Methods
public NavigationTemplatebuild()

Constructs the NavigationTemplate defined by this builder.

public NavigationTemplate.BuildersetActionStrip(ActionStrip actionStrip)

Sets an ActionStrip with a list of template-scoped actions for this template.

public NavigationTemplate.BuildersetBackgroundColor(CarColor backgroundColor)

Sets the background color to use for the navigation information.

public NavigationTemplate.BuildersetDestinationTravelEstimate(TravelEstimate destinationTravelEstimate)

Sets the TravelEstimate to the final destination.

public NavigationTemplate.BuildersetMapActionStrip(ActionStrip actionStrip)

Sets an ActionStrip with a list of map-control related actions for this template, such as pan or zoom.

public NavigationTemplate.BuildersetNavigationInfo(NavigationTemplate.NavigationInfo navigationInfo)

Sets the navigation information to display on the template.

public NavigationTemplate.BuildersetPanModeListener(PanModeListener panModeListener)

Sets a PanModeListener that notifies when the user enters and exits the pan mode.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Constructs an empty NavigationTemplate.Builder instance.

Methods

public NavigationTemplate.Builder setNavigationInfo(NavigationTemplate.NavigationInfo navigationInfo)

Sets the navigation information to display on the template.

Unless set with this method, navigation info won't be displayed on the template.

public NavigationTemplate.Builder setBackgroundColor(CarColor backgroundColor)

Sets the background color to use for the navigation information.

Depending on contrast requirements, capabilities of the vehicle screens, or other factors, the color may be ignored by the host or overridden by the vehicle system.

public NavigationTemplate.Builder setDestinationTravelEstimate(TravelEstimate destinationTravelEstimate)

Sets the TravelEstimate to the final destination.

public NavigationTemplate.Builder setActionStrip(ActionStrip actionStrip)

Sets an ActionStrip with a list of template-scoped actions for this template.

Requirements

Besides Action.APP_ICON and Action.BACK, this template requires at least 1 and up to 4 Actions in its ActionStrip. Of the 4 allowed Actions, only one can contain a title as set via . Otherwise, only Actions with icons are allowed.

public NavigationTemplate.Builder setMapActionStrip(ActionStrip actionStrip)

Sets an ActionStrip with a list of map-control related actions for this template, such as pan or zoom.

The host will draw the buttons in an area that is associated with map controls.

If the app does not include the Action.PAN button in this ActionStrip, the app will not receive the user input for panning gestures from SurfaceCallback methods, and the host will exit any previously activated pan mode.

Requirements

This template allows up to 4 Actions in its map ActionStrip. Only Actions with icons set via are allowed.

public NavigationTemplate.Builder setPanModeListener(PanModeListener panModeListener)

Sets a PanModeListener that notifies when the user enters and exits the pan mode.

If the app does not include the Action.PAN button in the map ActionStrip, the app will not receive the user input for panning gestures from SurfaceCallback methods, and the host will exit any previously activated pan mode.

public NavigationTemplate build()

Constructs the NavigationTemplate defined by this builder.