Row


@CarProtocol
class Row : Item


Represents a row with a title, several lines of text, an optional image, and an optional action or switch.

Summary

Nested types

A builder of Row.

Constants

const Int

Represents an extra small image to be displayed in the row.

const Int

Represents a small image to be displayed in the row.

const Int

Represents a large image to be displayed in the row.

const Int

Represents a small image to be displayed in the row.

const Int

An integer value indicating no decoration should be shown.

Public functions

Boolean
equals(other: Any?)
(Mutable)List<Action!>
@RequiresCarApi(value = 6)
getActions()

Returns the list of additional actions.

CarIcon?

Returns the image to display in the row or null if the row does not contain an image.

Metadata?

Returns the Metadata associated with the row or null if there is no metadata associated with the row.

Int

Returns the numeric decoration.

OnClickDelegate?

Returns the OnClickListener to be called back when the row is clicked or null if the row is non-clickable.

Int

Returns the type of the image in the row.

(Mutable)List<CarText!>

Returns the list of text below the title.

CarText?

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

Toggle?

Returns the Toggle in the row or null if the row does not contain a toggle.

Int
Boolean

Returns whether the row is browsable.

Boolean
@RequiresCarApi(value = 5)
isEnabled()

Returns true if the row is enabled.

Boolean

Returns whether this item can be included in indexed lists.

Row
row()

Returns a Row for rowing yourBoat

String
CharSequence

Rows your boat.

Constants

IMAGE_TYPE_EXTRA_SMALL

Added in 1.7.0-beta03
@ExperimentalCarApi
const val IMAGE_TYPE_EXTRA_SMALL = 8: Int

Represents an extra small image to be displayed in the row.

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 48 x 48 dp bounding box. If necessary, the image will be scaled down while preserving its aspect ratio.

IMAGE_TYPE_ICON

Added in 1.0.0
const val IMAGE_TYPE_ICON = 4: Int

Represents a small image to be displayed in the row.

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 88 x 88 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 row.

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 224 x 224 dp bounding box. If necessary, the image will be scaled down while preserving its aspect ratio.

IMAGE_TYPE_SMALL

Added in 1.0.0
const val IMAGE_TYPE_SMALL = 1: Int

Represents a small image to be displayed in the row.

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 88 x 88 dp bounding box. If necessary, the image will be scaled down while preserving its aspect ratio.

NO_DECORATION

Added in 1.3.0
const val NO_DECORATION = -1: Int

An integer value indicating no decoration should be shown.

Public functions

equals

fun equals(other: Any?): Boolean

getActions

Added in 1.3.0
@RequiresCarApi(value = 6)
fun getActions(): (Mutable)List<Action!>

Returns the list of additional actions.

Actions are displayed at the end of the row.

See also
addAction

getImage

Added in 1.0.0
fun getImage(): CarIcon?

Returns the image to display in the row or null if the row does not contain an image.

See also
setImage
setImage

getMetadata

Added in 1.0.0
fun getMetadata(): Metadata?

Returns the Metadata associated with the row or null if there is no metadata associated with the row.

getNumericDecoration

Added in 1.3.0
@RequiresCarApi(value = 6)
fun getNumericDecoration(): Int

Returns the numeric decoration.

Numeric decorations are displayed at the end of the row, but before any actions.

Numeric decorations are only allowed in full-width lists.

NO_DECORATION will be returned if the row does not contain a decoration.

getOnClickDelegate

Added in 1.0.0
fun getOnClickDelegate(): OnClickDelegate?

Returns the OnClickListener to be called back when the row is clicked or null if the row is non-clickable.

getRowImageType

Added in 1.0.0
fun getRowImageType(): Int

Returns the type of the image in the row.

getTexts

Added in 1.0.0
fun getTexts(): (Mutable)List<CarText!>

Returns the list of text below the title.

See also
addText

getTitle

Added in 1.0.0
fun getTitle(): CarText?

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

See also
setTitle

getToggle

Added in 1.0.0
fun getToggle(): Toggle?

Returns the Toggle in the row or null if the row does not contain a toggle.

See also
setToggle

hashCode

fun hashCode(): Int

isBrowsable

Added in 1.0.0
fun isBrowsable(): Boolean

Returns whether the row is browsable.

If a row is browsable, then no Action or Toggle can be added to it.

See also
isBrowsable

isEnabled

Added in 1.3.0
@RequiresCarApi(value = 5)
fun isEnabled(): Boolean

Returns true if the row is enabled.

isIndexable

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

Returns whether this item can be included in indexed lists.

See also
setIndexable

row

Added in 1.0.0
fun row(): Row

Returns a Row for rowing yourBoat

toString

fun toString(): String

yourBoat

Added in 1.0.0
fun yourBoat(): CharSequence

Rows your boat.

Example usage:

row.row().row().yourBoat(); // gently down the stream