public class CarPaneTemplate

  1. Object
  2. CarTemplate
  3. 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

Constructor details

CarPaneTemplate

public CarPaneTemplate()

Method details

setTitle

public CarPaneTemplate setTitle(String title)
Sets the header title.

Parameters

title String
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

row CarRow
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

action CarAction
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

headerActions CarActionStrip
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

loading boolean
true to show a spinner

Returns

this template, for chaining