GridItem


@CarProtocol
class GridItem : Item


Represents a grid item with an image and an optional title.

Summary

Nested types

A builder of GridItem.

Constants

const Int

Represents an icon to be displayed in the grid item.

const Int

Represents a large image to be displayed in the grid item.

Public functions

Boolean
equals(other: Any?)
Badge?

Returns the Badge that is displayed over the grid item image or null if not set.

CarIcon?

Returns the image of the grid item or null if not set.

Int

Returns the image type of the grid item.

OnClickDelegate?

Returns the OnClickDelegate to be called back when the grid item is clicked or null if the grid item is non-clickable.

CarText?

Returns the text to display below the title or null if no text will be displayed below the title.

CarText?

Returns the title of the grid item or null if not set.

Int
Boolean

Returns whether this item can be included in indexed lists.

Boolean

Returns whether the grid item is in a loading state.

String

Constants

IMAGE_TYPE_ICON

Added in 1.0.0
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

Added in 1.0.0
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

equals

fun equals(other: Any?): Boolean

getBadge

Added in 1.4.0
@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

Added in 1.0.0
fun getImage(): CarIcon?

Returns the image of the grid item or null if not set.

See also
setImage

getImageType

Added in 1.0.0
fun getImageType(): Int

Returns the image type of the grid item.

getOnClickDelegate

Added in 1.0.0
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

Added in 1.0.0
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

Added in 1.0.0
fun getTitle(): CarText?

Returns the title of the grid item or null if not set.

See also
setTitle

hashCode

fun hashCode(): Int

isIndexable

Added in 1.7.0-beta03
@ExperimentalCarApi
fun isIndexable(): Boolean

Returns whether this item can be included in indexed lists.

See also
setIndexable

isLoading

Added in 1.0.0
fun isLoading(): Boolean

Returns whether the grid item is in a loading state.

See also
setLoading

toString

fun toString(): String