GridTemplate


@CarProtocol
class GridTemplate : Template


A template representing a grid of items.

Template Restrictions In regards to template refreshes, as described in onGetTemplate, this template is considered a refresh of a previous one if:
  • The previous template is in a loading state (see setLoading, or
  • The template title has not changed, and the number of grid items and the title of each grid item have not changed.

Summary

Nested types

A builder of GridTemplate.

Constants

const Int

Represents a preference to crop all grid item images into the shape of a circle.

const Int

Represents a preference to keep the images as-is without modifying their shape.

const Int

Represents a large size for all grid items within a template.

const Int

Represents a medium size for all grid items within a template.

const Int

Represents a small size for all grid items within a template.

Public functions

Boolean
equals(other: Any?)
ActionStrip?

This function is deprecated.

use getEndHeaderActions instead.

(Mutable)List<Action!>

Returns the list of additional actions.

Header?

Returns the Header to display in this template.

Action?

This function is deprecated.

use getStartHeaderAction instead.

Int

Returns the item image shape.

Int

Returns the grid item size, which applies to all grid items in the template.

ItemList?

Returns the ItemList instance that contains the grid items to display or null if not set.

CarText?

This function is deprecated.

use getTitle instead.

Int
Boolean

Returns whether the template is loading.

String

Constants

ITEM_IMAGE_SHAPE_CIRCLE

Added in 1.4.0
@ExperimentalCarApi
const val ITEM_IMAGE_SHAPE_CIRCLE = 2: Int

Represents a preference to crop all grid item images into the shape of a circle.

ITEM_IMAGE_SHAPE_UNSET

Added in 1.4.0
@ExperimentalCarApi
const val ITEM_IMAGE_SHAPE_UNSET = 1: Int

Represents a preference to keep the images as-is without modifying their shape.

This is the default setting.

ITEM_SIZE_LARGE

Added in 1.4.0
@ExperimentalCarApi
const val ITEM_SIZE_LARGE = 4: Int

Represents a large size for all grid items within a template.

See also
setItemSize

ITEM_SIZE_MEDIUM

Added in 1.4.0
@ExperimentalCarApi
const val ITEM_SIZE_MEDIUM = 2: Int

Represents a medium size for all grid items within a template.

See also
setItemSize

ITEM_SIZE_SMALL

Added in 1.4.0
@ExperimentalCarApi
const val ITEM_SIZE_SMALL = 1: Int

Represents a small size for all grid items within a template. This is the default size.

See also
setItemSize

Public functions

equals

fun equals(other: Any?): Boolean

getActionStrip

Added in 1.0.0
Deprecated in 1.7.0-alpha01
fun getActionStrip(): ActionStrip?

Returns the ActionStrip for this template or null if not set.

See also
setActionStrip

getActions

Added in 1.4.0
@ExperimentalCarApi
@RequiresCarApi(value = 7)
fun getActions(): (Mutable)List<Action!>

Returns the list of additional actions.

See also
addAction

getHeader

Added in 1.7.0-alpha01
fun getHeader(): Header?

Returns the Header to display in this template.

This method was introduced in API 7, but is backwards compatible even if the client is using API 6 or below.

See also
setHeader

getHeaderAction

Added in 1.0.0
Deprecated in 1.7.0-alpha01
fun getHeaderAction(): Action?

Returns the Action that is set to be displayed in the header of the template, or null if not set.

See also
setHeaderAction

getItemImageShape

Added in 1.4.0
@ExperimentalCarApi
fun getItemImageShape(): Int

Returns the item image shape.

All item images in the grid are cropped into the specified shape.

getItemSize

Added in 1.4.0
@ExperimentalCarApi
fun getItemSize(): Int

Returns the grid item size, which applies to all grid items in the template.

See also
setItemSize

getSingleList

Added in 1.0.0
fun getSingleList(): ItemList?

Returns the ItemList instance that contains the grid items to display or null if not set.

See also
setSingleList

getTitle

Added in 1.0.0
Deprecated in 1.7.0-alpha01
fun getTitle(): CarText?

Returns the title of the template or null if not set.

See also
setTitle

hashCode

fun hashCode(): Int

isLoading

Added in 1.0.0
fun isLoading(): Boolean

Returns whether the template is loading.

See also
setLoading

toString

fun toString(): String