GridItem
@CarProtocol
class GridItem : Item
Represents a grid item with an image and an optional title.
Summary
Nested types |
|---|
class GridItem.BuilderA builder of |
Constants |
|
|---|---|
const Int |
IMAGE_TYPE_ICON = 1Represents an icon to be displayed in the grid item. |
const Int |
IMAGE_TYPE_LARGE = 2Represents a large image to be displayed in the grid item. |
Public functions |
|
|---|---|
Boolean |
|
Badge? |
Returns the |
CarIcon? |
getImage()Returns the image of the grid item or |
Int |
Returns the image type of the grid item. |
OnClickDelegate? |
Returns the |
CarText? |
getText()Returns the text to display below the title or |
CarText? |
getTitle()Returns the title of the grid item or |
Int |
hashCode() |
Boolean |
Returns whether this item can be included in indexed lists. |
Boolean |
Returns whether the grid item is in a loading state. |
String |
toString() |
Constants
IMAGE_TYPE_ICON
const val IMAGE_TYPE_ICON = 1: Int
Represents an icon to be displayed in the grid item.
To minimize scaling artifacts across a wide range of car screens, apps should provide icons targeting a 128 x 128 dp bounding box. If necessary, the icon will be scaled down while preserving its aspect ratio.
A tint color is expected to be provided via setTint. Otherwise, a default tint color as determined by the host will be applied.
IMAGE_TYPE_LARGE
const val IMAGE_TYPE_LARGE = 2: Int
Represents a large image to be displayed in the grid item.
To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 128 x 128 dp bounding box. If necessary, the image will be scaled down while preserving its aspect ratio.
Public functions
getBadge
@ExperimentalCarApi
fun getBadge(): Badge?
Returns the Badge that is displayed over the grid item image or null if not set.
| See also | |
|---|---|
GridItem.Builder |
getImage
fun getImage(): CarIcon?
Returns the image of the grid item or null if not set.
| See also | |
|---|---|
setImage |
getOnClickDelegate
fun getOnClickDelegate(): OnClickDelegate?
Returns the OnClickDelegate to be called back when the grid item is clicked or null if the grid item is non-clickable.
getText
fun getText(): CarText?
Returns the text to display below the title or null if no text will be displayed below the title.
| See also | |
|---|---|
setText |
getTitle
fun getTitle(): CarText?
Returns the title of the grid item or null if not set.
| See also | |
|---|---|
setTitle |
isIndexable
@ExperimentalCarApi
fun isIndexable(): Boolean
Returns whether this item can be included in indexed lists.
| See also | |
|---|---|
setIndexable |
isLoading
fun isLoading(): Boolean
Returns whether the grid item is in a loading state.
| See also | |
|---|---|
setLoading |