Pane.Builder


class Pane.Builder


A builder of Pane.

Summary

Public constructors

Returns an empty Builder instance.

Public functions

Pane.Builder
addAction(action: Action)

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

Pane.Builder
addRow(row: Row)

Adds a row to display in the list.

Pane

Constructs the row list defined by this builder.

Pane.Builder
@RequiresCarApi(value = 4)
setImage(image: CarIcon)

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

Pane.Builder
setLoading(isLoading: Boolean)

Sets whether the Pane is in a loading state.

Public constructors

Builder

Added in 1.0.0
Builder()

Returns an empty Builder instance.

Public functions

addAction

Added in 1.0.0
fun addAction(action: Action): Pane.Builder

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

By default, no actions are displayed.

Throws
java.lang.NullPointerException

if action is null

addRow

Added in 1.0.0
fun addRow(row: Row): Pane.Builder

Adds a row to display in the list.

Throws
java.lang.NullPointerException

if row is null

build

Added in 1.0.0
fun build(): Pane

Constructs the row list defined by this builder.

Throws
java.lang.IllegalStateException

if the pane is in loading state and also contains rows, or vice versa

setImage

Added in 1.1.0
@RequiresCarApi(value = 4)
fun setImage(image: CarIcon): Pane.Builder

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 480 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.
Throws
java.lang.NullPointerException

if image is null

setLoading

Added in 1.0.0
fun setLoading(isLoading: Boolean): Pane.Builder

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 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
build