public class CarPaneTemplate
- Object
- CarTemplate
- CarPaneTemplate
A detail pane: a handful of informational
CarRows (label / value lines) plus up to two action
buttons. Use it for a POI detail card, a “now connected” status, or a confirmation screen. Maps
to androidx.car.app.model.PaneTemplate and CPInformationTemplate.Constructors
public CarPaneTemplate() |
Methods
public CarPaneTemplate setTitle(String title) | Sets the header title. |
public CarPaneTemplate addRow(CarRow row) | Adds an informational row (its title is the label, its text the value). |
public List<CarRow> getRows() | Returns the informational rows, in order. |
public CarPaneTemplate addAction(CarAction action) | Adds a pane action button (the head unit displays at most two). |
public List<CarAction> getActions() | Returns the pane action buttons, in order. |
public CarActionStrip getHeaderActions() | Returns the header action strip, or null. |
public CarPaneTemplate setHeaderActions(CarActionStrip headerActions) | Sets the header action strip. |
public boolean isLoading() | Returns true when the pane should render a loading spinner instead of content. |
public CarPaneTemplate setLoading(boolean loading) | Marks the template as loading; the head unit renders a spinner. |
Inherited methods
From CarTemplate
Constructor details
CarPaneTemplate
public CarPaneTemplate()Method details
setTitle
public CarPaneTemplate setTitle(String title)Sets the header title.
Parameters
titleString- the header title
Returns
this template, for chaining
addRow
public CarPaneTemplate addRow(CarRow row)Adds an informational row (its title is the label, its text the value).
Parameters
rowCarRow- the row to add
Returns
this template, for chaining
getRows
public List<CarRow> getRows()Returns the informational rows, in order.
addAction
public CarPaneTemplate addAction(CarAction action)Adds a pane action button (the head unit displays at most two).
Parameters
actionCarAction- the action button to add
Returns
this template, for chaining
getActions
public List<CarAction> getActions()Returns the pane action buttons, in order.
getHeaderActions
public CarActionStrip getHeaderActions()Returns the header action strip, or null.
setHeaderActions
public CarPaneTemplate setHeaderActions(CarActionStrip headerActions)Sets the header action strip.
Parameters
headerActionsCarActionStrip- the action strip
Returns
this template, for chaining
isLoading
public boolean isLoading()Returns true when the pane should render a loading spinner instead of content.
setLoading
public CarPaneTemplate setLoading(boolean loading)Marks the template as loading; the head unit renders a spinner.
Parameters
loadingboolean- true to show a spinner
Returns
this template, for chaining