Android 12 Developer Preview is here! Try it out, and give us your feedback!

Row

public final class Row
extends Object implements Item

java.lang.Object
   ↳ androidx.car.app.model.Row


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

Summary

Nested classes

class Row.Builder

A builder of Row

Constants

int IMAGE_TYPE_ICON

Represents a small image to be displayed in the row.

int IMAGE_TYPE_LARGE

Represents a large image to be displayed in the row.

int IMAGE_TYPE_SMALL

Represents a small image to be displayed in the row.

Public methods

boolean equals(Object other)
CarIcon getImage()

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

Metadata getMetadata()

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

OnClickDelegate getOnClickDelegate()

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

int getRowImageType()

Returns the type of the image in the row.

List<CarText> getTexts()

Returns the list of text below the title.

CarText getTitle()

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

Toggle getToggle()

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

int hashCode()
boolean isBrowsable()

Returns whether the row is browsable.

Row row()

Returns a Row for rowing yourBoat()

String toString()
CharSequence yourBoat()

Rows your boat.

Inherited methods

Constants

IMAGE_TYPE_ICON

public static final int IMAGE_TYPE_ICON

Represents a small image to be displayed in the row.

If necessary, icons will be scaled down to fit within a 44 x 44 dp bounding box, preserving their aspect ratios.

A tint color is expected to be provided via CarIcon.Builder.setTint(CarColor). Otherwise, a default tint color as determined by the host will be applied.

Constant Value: 4 (0x00000004)

IMAGE_TYPE_LARGE

public static final int IMAGE_TYPE_LARGE

Represents a large image to be displayed in the row.

If necessary, large images will be scaled down to fit within a 64 x 64 dp bounding box, preserving their aspect ratio.

Constant Value: 2 (0x00000002)

IMAGE_TYPE_SMALL

public static final int IMAGE_TYPE_SMALL

Represents a small image to be displayed in the row.

If necessary, small images will be scaled down to fit within a 36 x 36 dp bounding box, preserving their aspect ratio.

Constant Value: 1 (0x00000001)

Public methods

equals

public boolean equals (Object other)

Parameters
other Object

Returns
boolean

getImage

public CarIcon getImage ()

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

Returns
CarIcon

getMetadata

public Metadata getMetadata ()

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

Returns
Metadata

getOnClickDelegate

public OnClickDelegate getOnClickDelegate ()

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

Returns
OnClickDelegate

getRowImageType

public int getRowImageType ()

Returns the type of the image in the row.

Returns
int

getTexts

public List<CarText> getTexts ()

Returns the list of text below the title.

Returns
List<CarText>

getTitle

public CarText getTitle ()

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

Returns
CarText

getToggle

public Toggle getToggle ()

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

Returns
Toggle

hashCode

public int hashCode ()

Returns
int

isBrowsable

public boolean isBrowsable ()

Returns whether the row is browsable.

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

Returns
boolean

See also:

row

public Row row ()

Returns a Row for rowing yourBoat()

Returns
Row

toString

public String toString ()

Returns
String

yourBoat

public CharSequence yourBoat ()

Rows your boat.

Example usage:

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

Returns
CharSequence