Pane.Builder
public
static
final
class
Pane.Builder
extends Object
java.lang.Object | |
↳ | androidx.car.app.model.Pane.Builder |
A builder of Pane
.
Summary
Public constructors | |
---|---|
Builder()
Returns an empty |
Public methods | |
---|---|
Pane.Builder
|
addAction(Action action)
Adds an |
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
|
setLoading(boolean isLoading)
Sets whether the |
Inherited methods | |
---|---|
Public constructors
Public methods
addAction
public Pane.Builder addAction (Action action)
Adds an Action
to display alongside the rows in the pane.
By default, no actions are displayed.
Parameters | |
---|---|
action |
Action |
Returns | |
---|---|
Pane.Builder |
Throws | |
---|---|
NullPointerException |
if action is null
|
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 |
setLoading
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.
Parameters | |
---|---|
isLoading |
boolean |
Returns | |
---|---|
Pane.Builder |
See also: