public class CarSection

  1. Object
  2. CarSection
A titled group of CarRows within a CarListTemplate. Maps to a sectioned list (androidx.app.car ItemList with a header / CPListSection). The header may be null for an untitled section.

Constructors

public CarSection()Creates an untitled section.
public CarSection(String header)Creates a section with the supplied header.

Methods

public String getHeader()Returns the section header, or null.
public CarSection setHeader(String header)Sets the section header.
public CarSection addRow(CarRow row)Appends a row to the section.
public List<CarRow> getRows()Returns the rows in this section, in order.

Inherited methods

Constructor details

CarSection

public CarSection()
Creates an untitled section.

CarSection

public CarSection(String header)
Creates a section with the supplied header.

Parameters

header String
the section header, or null

Method details

getHeader

public String getHeader()
Returns the section header, or null.

setHeader

public CarSection setHeader(String header)
Sets the section header.

Parameters

header String
the header text, or null for an untitled section

Returns

this section, for chaining

addRow

public CarSection addRow(CarRow row)
Appends a row to the section.

Parameters

row CarRow
the row to add

Returns

this section, for chaining

getRows

public List<CarRow> getRows()
Returns the rows in this section, in order.