Class CarGridTemplate
java.lang.Object
com.codename1.car.CarTemplate
com.codename1.car.CarGridTemplate
A grid of image-forward
CarGridItems -- browse categories, station presets, playlist artwork.
Maps to androidx.car.app.model.GridTemplate and CPGridTemplate (which itself caps the grid,
typically at eight buttons; see CarContext#getGridItemLimit()).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddItem(CarGridItem item) Adds an item to the grid.Returns the header action strip, or null.getItems()Returns the grid items, in order.booleanReturns true when the grid should render a loading spinner instead of content.setHeaderActions(CarActionStrip headerActions) Sets the header action strip.setLoading(boolean loading) Marks the template as loading; the head unit renders a spinner.Sets the header title.Methods inherited from class CarTemplate
getTitle
-
Constructor Details
-
CarGridTemplate
public CarGridTemplate()
-
-
Method Details
-
setTitle
Sets the header title.
Parameters
title: the header title
Returns
this template, for chaining
-
addItem
Adds an item to the grid.
Parameters
item: the grid item to add
Returns
this template, for chaining
-
getItems
Returns the grid items, in order. -
getHeaderActions
Returns the header action strip, or null. -
setHeaderActions
Sets the header action strip.
Parameters
headerActions: the action strip
Returns
this template, for chaining
-
isLoading
public boolean isLoading()Returns true when the grid should render a loading spinner instead of content. -
setLoading
Marks the template as loading; the head unit renders a spinner.
Parameters
loading: true to show a spinner
Returns
this template, for chaining
-