MapWithContentTemplate.Builder


public final class MapWithContentTemplate.Builder


A builder of MapWithContentTemplate.

Summary

Public constructors

Public methods

@NonNull MapWithContentTemplate

Constructs the template defined by this builder.

@NonNull MapWithContentTemplate.Builder

Sets the ActionStrip for this template.

@NonNull MapWithContentTemplate.Builder

Sets the content to be displayed on top of the map tiles.

@NonNull MapWithContentTemplate.Builder

Sets the MapController for this template.

Public constructors

Builder

Added in 1.4.0
public Builder()

Public methods

build

Added in 1.4.0
public @NonNull MapWithContentTemplate build()

Constructs the template defined by this builder.

Requirements
Throws
java.lang.IllegalArgumentException

if the template is not one of the allowed Content types See setContentTemplate for the list of supported content templates.

setActionStrip

Added in 1.4.0
public @NonNull MapWithContentTemplate.Builder setActionStrip(@NonNull 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 setTitle, or a icon Action as set via setIcon.
Throws
java.lang.IllegalArgumentException

if actionStrip does not meet the requirements

java.lang.NullPointerException

if actionStrip is null

setContentTemplate

Added in 1.4.0
public @NonNull MapWithContentTemplate.Builder setContentTemplate(@NonNull Template template)

Sets the content to be displayed on top of the map tiles.

From Car API 7 onward, the following template types are supported as content:

  • ListTemplate
  • PaneTemplate
  • GridTemplate
  • MessageTemplate
Throws
java.lang.NullPointerException

if template is null

java.lang.IllegalArgumentException

if template does not meet the requirements

setMapController

Added in 1.4.0
public @NonNull MapWithContentTemplate.Builder setMapController(@NonNull MapController mapController)

Sets the MapController for this template.