public final class

PaneTemplate.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.model.PaneTemplate.Builder

Overview

A builder of PaneTemplate.

Summary

Constructors
publicBuilder(Pane pane)

Returns a new instance of a @link Builder}.

Methods
public PaneTemplatebuild()

Constructs the template defined by this builder.

public PaneTemplate.BuildersetActionStrip(ActionStrip actionStrip)

Sets the ActionStrip for this template.

public PaneTemplate.BuildersetHeader(Header header)

Sets the Header for this template.

public PaneTemplate.BuildersetHeaderAction(Action headerAction)

Sets the Action that will be displayed in the header of the template.

public PaneTemplate.BuildersetTitle(java.lang.CharSequence title)

Sets the title of the template.

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

Constructors

public Builder(Pane pane)

Returns a new instance of a @link Builder}.

Methods

public PaneTemplate.Builder setTitle(java.lang.CharSequence title)

Deprecated: Use Header.Builder.setTitle(CarText)

Sets the title of the template.

Unless set with this method, the template will not have a title.

Only DistanceSpans, DurationSpans and CarIconSpan are supported in the input string.

See also: CarText

public PaneTemplate.Builder setHeader(Header header)

Sets the Header for this template.

The end header actions will show up differently inside vs outside of a map template. See Header.Builder.addEndHeaderAction(Action) for more details.

public PaneTemplate.Builder setHeaderAction(Action headerAction)

Deprecated: Use Header.Builder.setStartHeaderAction(Action)

Sets the Action that will be displayed in the header of the template.

Unless set with this method, the template will not have a header action.

Requirements

This template only supports either one of Action.APP_ICON and Action.BACK as a header Action.

public PaneTemplate.Builder setActionStrip(ActionStrip actionStrip)

Deprecated: Use for each action

Sets the ActionStrip for this template.

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

Requirements

This template allows up to 2 Actions in its ActionStrip. Of the 2 allowed Actions, one of them can contain a title as set via Action.Builder.setTitle(CharSequence). Otherwise, only Actions with icons are allowed.

public PaneTemplate build()

Constructs the template defined by this builder.

Requirements

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 Row.Builder.addText(CharSequence) 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)