Pane.Builder

public static class Pane.Builder
extends Object

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


A builder of Pane.

Summary

Public constructors

Builder()

Public methods

Pane.Builder addRow(Row row)

Adds a row to display in the list.

Pane build()

Constructs the row list defined by this builder.

Pane.Builder clearRows()

Clears any rows that may have been added with addRow(Row) up to this point.

Pane.Builder setActions(List<Action> actions)

Sets multiple Actions to display alongside the rows in the pane.

Pane.Builder setIsLoading(boolean isLoading)

Sets whether the Pane is in a loading state.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

addRow

public Pane.Builder addRow (Row row)

Adds a row to display in the list.

Parameters
row Row

Returns
Pane.Builder

Throws
NullPointerException if row is null.

build

public Pane build ()

Constructs the row list defined by this builder.

Returns
Pane

Throws
IllegalStateException if the pane is in loading state and also contains rows, or vice-versa.

clearRows

public Pane.Builder clearRows ()

Clears any rows that may have been added with addRow(Row) up to this point.

Returns
Pane.Builder

setActions

public Pane.Builder setActions (List<Action> actions)

Sets multiple Actions to display alongside the rows in the pane.

By default, no actions are displayed.

Parameters
actions List

Returns
Pane.Builder

Throws
NullPointerException if actions is null.

setIsLoading

public Pane.Builder setIsLoading (boolean isLoading)

Sets whether the Pane is in a loading state.

If set to true, the UI will display a loading indicator where the list content would be otherwise. The caller is expected to call Screen.invalidate() and send the new template content to the host once the data is ready. If set to false, the UI shows the actual row contents.

Parameters
isLoading boolean

Returns
Pane.Builder

See also: