Row
@CarProtocol
public final class Row implements Item
Represents a row with a title, several lines of text, an optional image, and an optional action or switch.
Summary
Nested types |
|---|
public final class Row.BuilderA builder of |
Constants |
|
|---|---|
static final int |
Represents an extra small image to be displayed in the row. |
static final int |
IMAGE_TYPE_ICON = 4Represents a small image to be displayed in the row. |
static final int |
IMAGE_TYPE_LARGE = 2Represents a large image to be displayed in the row. |
static final int |
IMAGE_TYPE_SMALL = 1Represents a small image to be displayed in the row. |
static final int |
NO_DECORATION = -1An integer value indicating no decoration should be shown. |
Public methods |
|
|---|---|
boolean |
|
@NonNull List<Action> |
@RequiresCarApi(value = 6)Returns the list of additional actions. |
@Nullable CarIcon |
@RequiresCarApi(value = 8)Returns a fixed-sized image to display at the end of the row content, or |
@Nullable CarIcon |
getImage()Returns the image to display in the row or |
@Nullable Metadata |
Returns the |
int |
@RequiresCarApi(value = 6)Returns the numeric decoration. |
@Nullable OnClickDelegate |
Returns the |
int |
@RequiresCarApi(value = 8)Returns the type of the end image in the row. |
int |
Returns the type of the image in the row. |
@NonNull List<CarText> |
getTexts()Returns the list of text below the title. |
@Nullable CarText |
getTitle()Returns the title of the row or |
@Nullable Toggle |
Returns the |
int |
hashCode() |
boolean |
Returns whether the row is browsable. |
boolean |
@RequiresCarApi(value = 5)Returns |
boolean |
Returns whether this item can be included in indexed lists. |
@NonNull Row |
row() |
@NonNull String |
toString() |
@NonNull CharSequence |
yourBoat()Rows your boat. |
Constants
IMAGE_TYPE_EXTRA_SMALL
@ExperimentalCarApi
public static final int IMAGE_TYPE_EXTRA_SMALL = 8
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
public static final int IMAGE_TYPE_ICON = 4
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
public static final int IMAGE_TYPE_LARGE = 2
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
public static final int IMAGE_TYPE_SMALL = 1
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
public static final int NO_DECORATION = -1
An integer value indicating no decoration should be shown.
Public methods
getActions
@RequiresCarApi(value = 6)
public @NonNull List<Action> getActions()
Returns the list of additional actions.
Actions are displayed at the end of the row.
| See also | |
|---|---|
addAction |
getEndImage
@RequiresCarApi(value = 8)
public @Nullable CarIcon getEndImage()
Returns a fixed-sized image to display at the end of the row content, or null if not set.
| See also | |
|---|---|
setEndImage |
getImage
public @Nullable CarIcon getImage()
Returns the image to display in the row or null if the row does not contain an image.
getMetadata
public @Nullable Metadata getMetadata()
Returns the Metadata associated with the row or null if there is no metadata associated with the row.
getNumericDecoration
@RequiresCarApi(value = 6)
public int getNumericDecoration()
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.
| See also | |
|---|---|
setNumericDecoration |
getOnClickDelegate
public @Nullable OnClickDelegate getOnClickDelegate()
Returns the OnClickListener to be called back when the row is clicked or
null if the row is non-clickable.
getRowEndImageType
@RequiresCarApi(value = 8)
public int getRowEndImageType()
Returns the type of the end image in the row.
getRowImageType
public int getRowImageType()
Returns the type of the image in the row.
getTexts
public @NonNull List<CarText> getTexts()
Returns the list of text below the title.
| See also | |
|---|---|
addText |
getTitle
public @Nullable CarText getTitle()
Returns the title of the row or null if not set.
| See also | |
|---|---|
setTitle |
getToggle
public @Nullable Toggle getToggle()
Returns the Toggle in the row or null if the row does not contain a toggle.
| See also | |
|---|---|
setToggle |
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.
| See also | |
|---|---|
isBrowsable |
isEnabled
@RequiresCarApi(value = 5)
public boolean isEnabled()
Returns true if the row is enabled.
isIndexable
@ExperimentalCarApi
public boolean isIndexable()
Returns whether this item can be included in indexed lists.
| See also | |
|---|---|
setIndexable |
yourBoat
public @NonNull CharSequence yourBoat()
Rows your boat.
Example usage:
row.row().row().yourBoat(); // gently down the stream