Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

PaneTemplate.Builder

public static final class PaneTemplate.Builder
extends Object

java.lang.Object
   ↳ com.google.android.libraries.car.app.model.PaneTemplate.Builder


A builder of PaneTemplate.

Summary

Public methods

PaneTemplate build()

Constructs the template defined by this builder.

PaneTemplate.Builder setActionStrip(ActionStrip actionStrip)

Sets the ActionStrip for this template.

PaneTemplate.Builder setHeaderAction(Action headerAction)

Sets the Action that will be displayed in the header of the template, or null to not display an action.

PaneTemplate.Builder setPane(Pane pane)

Sets the Pane to display in the template.

PaneTemplate.Builder setTitle(CharSequence title)

Sets the CharSequence to show as the template's title, or null to not show a title.

Inherited methods

Public methods

build

public PaneTemplate build ()

Constructs the template defined by this builder.

Requirements

This template allows up to 2 Rows and 2 Actions in the 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.

Either a header Action or title must be set on the template.

Returns
PaneTemplate

Throws
IllegalArgumentException if the Pane does not meet the requirements.
IllegalStateException if the template does not have either a title or header Action set.

setActionStrip

public PaneTemplate.Builder setActionStrip (ActionStrip actionStrip)

Sets the ActionStrip for this template.

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.

Parameters
actionStrip ActionStrip

Returns
PaneTemplate.Builder

Throws
IllegalArgumentException if actionStrip does not meet the requirements.

setHeaderAction

public PaneTemplate.Builder setHeaderAction (Action headerAction)

Sets the Action that will be displayed in the header of the template, or null to not display an action.

Requirements

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

Parameters
headerAction Action

Returns
PaneTemplate.Builder

Throws
IllegalArgumentException if headerAction does not meet the template's requirements.

setPane

public PaneTemplate.Builder setPane (Pane pane)

Sets the Pane to display in the template.

Parameters
pane Pane

Returns
PaneTemplate.Builder

Throws
NullPointerException if pane is null.

setTitle

public PaneTemplate.Builder setTitle (CharSequence title)

Sets the CharSequence to show as the template's title, or null to not show a title.

Parameters
title CharSequence

Returns
PaneTemplate.Builder