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 |
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 |
Metadata
|
getMetadata()
Returns the |
OnClickDelegate
|
getOnClickDelegate()
Returns the |
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 |
Toggle
|
getToggle()
Returns the |
int
|
hashCode()
|
boolean
|
isBrowsable()
Returns whether the row is browsable. |
Row
|
row()
Returns a |
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.
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 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.
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.
Constant Value: 2 (0x00000002)
IMAGE_TYPE_SMALL
public static final int IMAGE_TYPE_SMALL
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.
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> |
|
See also:
getTitle
public CarText getTitle ()
Returns the title of the row or null if not set.
| Returns | |
|---|---|
CarText |
|
See also:
getToggle
public Toggle getToggle ()
Returns the Toggle in the row or null if the row does not contain a
toggle.
| Returns | |
|---|---|
Toggle |
|
See also:
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:
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 |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-06-16 UTC.