public final class

MapTemplate.Builder

extends java.lang.Object

 java.lang.Object

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

Overview

A builder of MapTemplate.

Summary

Constructors
publicBuilder()

Methods
public MapTemplatebuild()

Constructs the template defined by this builder.

public MapTemplate.BuildersetActionStrip(ActionStrip actionStrip)

Sets the ActionStrip for this template.

public MapTemplate.BuildersetHeader(Header header)

Sets the Header for this template.

public MapTemplate.BuildersetItemList(ItemList itemList)

Sets an ItemList to show in a list view along with the map.

public MapTemplate.BuildersetMapController(MapController mapController)

Sets the MapController for this template.

public MapTemplate.BuildersetPane(Pane pane)

Sets the Pane for this template.

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

Constructors

public Builder()

Methods

public MapTemplate.Builder setActionStrip(ActionStrip actionStrip)

Sets the ActionStrip for this template.

Unless set with this method, the template will not have an action strip.

The Action buttons in Map Based Template are automatically adjusted based on the screen size. On narrow width screen, icon Actions show by default. If no icon specify, showing title Actions instead. On wider width screen, title Actions show by default. If no title specify, showing icon Actions instead.

Requirements

This template allows up to 4 Actions in its ActionStrip. Of the 4 allowed Actions, it can either be a title Action as set via , or a icon Action as set via .

public MapTemplate.Builder setPane(Pane pane)

Sets the Pane for this template. Pane.getImage() for pane will not be shown in MapTemplate.

Unless set with this method, the template will not show a pane.

Requirements

The number of items in the Pane should be smaller or equal than the limit provided by ConstraintManager.CONTENT_LIMIT_TYPE_PANE. The host via and cannot contain either a Toggle or a OnClickListener.

Up to 2 Actions are allowed in the Pane. Each action's title color can be customized with ForegroundCarColorSpan instances. Any other span is not supported.

If none of the header Action, the header title or the action strip have been set on the template, the header is hidden.

See also: ConstraintManager.getContentLimit(int)

public MapTemplate.Builder setItemList(ItemList itemList)

Sets an ItemList to show in a list view along with the map.

Unless set with this method, the template will not show an item list.

To show a marker corresponding to a point of interest represented by a row, set the Place instance via . The host will display the PlaceMarker in both the map and the list view as the row becomes visible.

Requirements

The number of items in the ItemList should be smaller or equal than the limit provided by ConstraintManager.CONTENT_LIMIT_TYPE_PLACE_LIST. The host will ignore any items over that limit. The list itself cannot be selectable as set via . Each Row can add up to 2 lines of texts via and cannot contain a Toggle.

Images of type Row.IMAGE_TYPE_LARGE are not allowed in this template.

Rows are not allowed to have both an image and a place marker.

See also: ConstraintManager.getContentLimit(int)

public MapTemplate.Builder setHeader(Header header)

Sets the Header for this template.

public MapTemplate.Builder setMapController(MapController mapController)

Sets the MapController for this template.

public MapTemplate build()

Constructs the template defined by this builder.

Requirements

A Pane and a Header must be set on the component.

The number of items in the ItemList should be smaller or equal than the limit provided by ConstraintManager.CONTENT_LIMIT_TYPE_PANE. The host will ignore any rows over that limit. Each Rows can add up to 2 lines of texts via and cannot contain either a Toggle or a OnClickListener.

Up to 2 Actions are allowed in the Pane. Each action's title color can be customized with ForegroundCarColorSpan instances. Any other span is not supported.

If neither header Action nor title have been set on the template, the header is hidden.