public final class

Pane.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.model.Pane.Builder

Overview

A builder of Pane.

Summary

Constructors
publicBuilder()

Returns an empty Pane.Builder instance.

Methods
public Pane.BuilderaddAction(Action action)

Adds an Action to display alongside the rows in the pane.

public Pane.BuilderaddRow(Row row)

Adds a row to display in the list.

public Panebuild()

Constructs the row list defined by this builder.

public Pane.BuildersetImage(CarIcon image)

Sets an CarIcon to display alongside the rows in the pane.

public Pane.BuildersetLoading(boolean isLoading)

Sets whether the Pane is in a loading state.

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

Constructors

public Builder()

Returns an empty Pane.Builder instance.

Methods

public Pane.Builder setLoading(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.

See also: Pane.Builder.build()

public Pane.Builder addRow(Row row)

Adds a row to display in the list.

public Pane.Builder addAction(Action action)

Adds an Action to display alongside the rows in the pane.

By default, no actions are displayed.

public Pane.Builder setImage(CarIcon image)

Sets an CarIcon to display alongside the rows in the pane.

Image Sizing Guidance

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 480 x 854 (9:16) dp bounding box. If the image exceeds this maximum size in either one of the dimensions, it will be scaled down to be centered inside the bounding box while preserving its aspect ratio.

public Pane build()

Constructs the row list defined by this builder.