Class CarGridItem
java.lang.Object
com.codename1.car.CarGridItem
A single cell in a
CarGridTemplate: a large image with a short title and optional secondary
text. Maps to androidx.car.app.model.GridItem and to a CPGridButton on CarPlay. Grid items
are image-forward (browse categories, presets, playlists) -- always supply an image.-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty grid item.CarGridItem(String title, Image image) Creates a grid item with a title and image. -
Method Summary
Modifier and TypeMethodDescriptiongetImage()Returns the item image, or null.Returns the activation listener, or null.getText()Returns the secondary text line, or null.getTitle()Returns the item title.Sets the item image.setOnAction(CarActionListener listener) Sets the listener invoked (on the EDT) when the item is selected.Sets the secondary text line.Sets the item title.
-
Constructor Details
-
CarGridItem
public CarGridItem()Creates an empty grid item. -
CarGridItem
-
-
Method Details
-
getTitle
Returns the item title. -
setTitle
Sets the item title.
Parameters
title: the label
Returns
this item, for chaining
-
getText
Returns the secondary text line, or null. -
setText
Sets the secondary text line.
Parameters
text: the secondary line
Returns
this item, for chaining
-
getImage
Returns the item image, or null. -
setImage
Sets the item image.
Parameters
image: the image
Returns
this item, for chaining
-
getOnAction
Returns the activation listener, or null. -
setOnAction
Sets the listener invoked (on the EDT) when the item is selected.
Parameters
listener: the activation callback
Returns
this item, for chaining
-