MapTemplate.Builder
public final class MapTemplate.Builder
A builder of MapTemplate.
Summary
Public constructors |
|---|
|
Public methods |
|
|---|---|
@NonNull MapTemplate |
Constructs the template defined by this builder. |
@NonNull MapTemplate.Builder |
Sets the |
@NonNull MapTemplate.Builder |
Sets the |
@NonNull MapTemplate.Builder |
Sets an |
@NonNull MapTemplate.Builder |
Sets the |
@NonNull MapTemplate.Builder |
Sets the |
Public constructors
Public methods
public @NonNull MapTemplatebuild()
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 CONTENT_LIMIT_TYPE_PANE. The host will ignore any rows over that limit. Each Rows can add up to 2 lines of texts via addText 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.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if the |
java.lang.IllegalStateException |
public @NonNull MapTemplate.BuildersetActionStrip(@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 4Actions 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 |
java.lang.NullPointerException |
if |
public @NonNull MapTemplate.BuildersetHeader(@NonNull Header header)
Sets the Header for this template.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
public @NonNull MapTemplate.BuildersetItemList(@NonNull 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 setMetadata. 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 theItemList should be smaller or equal than the limit provided by CONTENT_LIMIT_TYPE_PLACE_LIST. The host will ignore any items over that limit. The list itself cannot be selectable as set via setOnSelectedListener. Each Row can add up to 2 lines of texts via addText and cannot contain a Toggle.
Images of type IMAGE_TYPE_LARGE are not allowed in this template.
Rows are not allowed to have both an image and a place marker.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
java.lang.NullPointerException |
if |
| See also | |
|---|---|
getContentLimit |
public @NonNull MapTemplate.BuildersetMapController(@NonNull MapController mapController)
Sets the MapController for this template.
public @NonNull MapTemplate.BuildersetPane(@NonNull Pane pane)
Sets the Pane for this template. 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 thePane should be smaller or equal than the limit provided by CONTENT_LIMIT_TYPE_PANE. The host via addText 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.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if the |
java.lang.NullPointerException |
if |
| See also | |
|---|---|
getContentLimit |