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 |
|---|
class Row.BuilderA builder of |
Constants |
|
|---|---|
const Int |
@RequiresCarApi(value = 8)Represents an extra small image to be displayed in the row. |
const Int |
IMAGE_TYPE_ICON = 4Represents a small image to be displayed in the row. |
const Int |
IMAGE_TYPE_LARGE = 2Represents a large image to be displayed in the row. |
const Int |
@RequiresCarApi(value = 8)Represents a medium image to be displayed in the row. |
const Int |
IMAGE_TYPE_SMALL = 1Represents a small image to be displayed in the row. |
const Int |
NO_DECORATION = -1An integer value indicating no decoration should be shown. |
Public functions |
|
|---|---|
Boolean |
|
(Mutable)List<Action!> |
@RequiresCarApi(value = 6)Returns the list of additional actions. |
CarIcon? |
@RequiresCarApi(value = 8)Returns a fixed-sized image to display at the end of the row content, or |
CarIcon? |
getImage()Returns the image to display in the row or |
Metadata? |
Returns the |
Int |
@RequiresCarApi(value = 6)Returns the numeric decoration. |
OnClickDelegate? |
Returns the |
CarProgressBar? |
@RequiresCarApi(value = 9)Returns the progress bar to display in the row, or |
Int |
@RequiresCarApi(value = 8)Returns the type of the end image in the row. |
Int |
Returns the type of the image in the row. |
(Mutable)List<CarText!> |
getTexts()Returns the list of text below the title. |
CarText? |
getTitle()Returns the title of the row or |
Toggle? |
Returns the |
Int |
hashCode() |
Boolean |
Returns whether the row is browsable. |
Boolean |
@RequiresCarApi(value = 5)Returns |
Boolean |
@RequiresCarApi(value = 8)Returns whether this item can be included in indexed lists. |
Row |
row() |
String |
toString() |
CharSequence |
yourBoat()Rows your boat. |
Constants
IMAGE_TYPE_EXTRA_SMALL
@RequiresCarApi(value = 8)
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
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
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_MEDIUM
@RequiresCarApi(value = 8)
const val IMAGE_TYPE_MEDIUM = 16: Int
Represents a medium image to be displayed in the row.
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.
IMAGE_TYPE_SMALL
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
const val NO_DECORATION = -1: Int
An integer value indicating no decoration should be shown.
Public functions
getActions
@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 |
getEndImage
@RequiresCarApi(value = 8)
fun getEndImage(): CarIcon?
Returns a fixed-sized image to display at the end of the row content, or null if not set.
| See also | |
|---|---|
setEndImage |
getImage
fun getImage(): CarIcon?
Returns the image to display in the row or null if the row does not contain an image.
getMetadata
fun getMetadata(): Metadata?
Returns the Metadata associated with the row or null if there is no metadata associated with the row.
getNumericDecoration
@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.
| See also | |
|---|---|
setNumericDecoration |
getOnClickDelegate
fun getOnClickDelegate(): OnClickDelegate?
Returns the OnClickListener to be called back when the row is clicked or
null if the row is non-clickable.
getProgressBar
@RequiresCarApi(value = 9)
@ExperimentalCarApi
fun getProgressBar(): CarProgressBar?
Returns the progress bar to display in the row, or null if not set.
| See also | |
|---|---|
setProgressBar |
getRowEndImageType
@RequiresCarApi(value = 8)
fun getRowEndImageType(): Int
Returns the type of the end image in the row.
getTexts
fun getTexts(): (Mutable)List<CarText!>
Returns the list of text below the title.
| See also | |
|---|---|
addText |
getTitle
fun getTitle(): CarText?
Returns the title of the row or null if not set.
| See also | |
|---|---|
setTitle |
getToggle
fun getToggle(): Toggle?
Returns the Toggle in the row or null if the row does not contain a toggle.
| See also | |
|---|---|
setToggle |
isBrowsable
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
@RequiresCarApi(value = 5)
fun isEnabled(): Boolean
Returns true if the row is enabled.
isIndexable
@RequiresCarApi(value = 8)
fun isIndexable(): Boolean
Returns whether this item can be included in indexed lists.
| See also | |
|---|---|
setIndexable |
yourBoat
fun yourBoat(): CharSequence
Rows your boat.
Example usage:
row.row().row().yourBoat(); // gently down the stream