# Row

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/Row.java+class:androidx.car.app.model.Row) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public final class Row implements Item
```

<br />

*** ** * ** ***

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 https://developer.android.com/reference/androidx/car/app/model/Row.Builder` A builder of `https://developer.android.com/reference/androidx/car/app/model/Row`. |

| ### Constants |
|---|---|
| `static final int` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 8) https://developer.android.com/reference/androidx/car/app/model/Row#IMAGE_TYPE_EXTRA_SMALL() = 8` Represents an extra small image to be displayed in the row. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/Row#IMAGE_TYPE_ICON() = 4` **This field is deprecated.** Use `https://developer.android.com/reference/androidx/car/app/model/Row#IMAGE_TYPE_SMALL()` instead and set explicit tint via `https://developer.android.com/reference/androidx/car/app/model/CarIcon.Builder#setTint(androidx.car.app.model.CarColor)` if needed. <br /> |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/Row#IMAGE_TYPE_LARGE() = 2` Represents a large image to be displayed in the row. |
| `static final int` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 8) https://developer.android.com/reference/androidx/car/app/model/Row#IMAGE_TYPE_MEDIUM() = 16` Represents a medium image to be displayed in the row. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/Row#IMAGE_TYPE_SMALL() = 1` Represents a small image to be displayed in the row. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/model/Row#NO_DECORATION() = -1` An integer value indicating no decoration should be shown. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/Row#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/car/app/model/Action>` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 6) https://developer.android.com/reference/androidx/car/app/model/Row#getActions()()` Returns the list of additional actions. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarIcon` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 8) https://developer.android.com/reference/androidx/car/app/model/Row#getEndImage()()` Returns a fixed-sized image to display at the end of the row content, or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarIcon` | `https://developer.android.com/reference/androidx/car/app/model/Row#getImage()()` Returns the image to display in the row or `null` if the row does not contain an image. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Metadata` | `https://developer.android.com/reference/androidx/car/app/model/Row#getMetadata()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/Metadata` associated with the row or `null` if there is no metadata associated with the row. |
| `int` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 6) https://developer.android.com/reference/androidx/car/app/model/Row#getNumericDecoration()()` Returns the numeric decoration. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/OnClickDelegate` | `https://developer.android.com/reference/androidx/car/app/model/Row#getOnClickDelegate()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/OnClickListener` to be called back when the row is clicked or ` null` if the row is non-clickable. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarProgressBar` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 9) @https://developer.android.com/reference/androidx/car/app/annotations/ExperimentalCarApi https://developer.android.com/reference/androidx/car/app/model/Row#getProgressBar()()` Returns the progress bar to display in the row, or `null` if not set. |
| `int` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 8) https://developer.android.com/reference/androidx/car/app/model/Row#getRowEndImageType()()` Returns the type of the end image in the row. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/Row#getRowImageType()()` Returns the type of the image in the row. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/car/app/model/CarText>` | `https://developer.android.com/reference/androidx/car/app/model/Row#getTexts()()` Returns the list of text below the title. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/model/Row#getTitle()()` Returns the title of the row or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Toggle` | `https://developer.android.com/reference/androidx/car/app/model/Row#getToggle()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/Toggle` in the row or `null` if the row does not contain a toggle. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/Row#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/Row#isBrowsable()()` Returns whether the row is browsable. |
| `boolean` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 5) https://developer.android.com/reference/androidx/car/app/model/Row#isEnabled()()` Returns `true` if the row is enabled. |
| `boolean` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 8) https://developer.android.com/reference/androidx/car/app/model/Row#isIndexable()()` Returns whether this item can be included in indexed lists. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/Row` | `https://developer.android.com/reference/androidx/car/app/model/Row#row()()` Returns a `https://developer.android.com/reference/androidx/car/app/model/Row` for rowing `https://developer.android.com/reference/androidx/car/app/model/Row#yourBoat()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/Row#toString()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/car/app/model/Row#yourBoat()()` Rows your boat. |

## Constants

### IMAGE_TYPE_EXTRA_SMALL

Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)

```
@RequiresCarApi(value = 8)
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

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0) Deprecated in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
public static final int IMAGE_TYPE_ICON = 4
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/car/app/model/Row#IMAGE_TYPE_SMALL()` instead and set explicit tint via `https://developer.android.com/reference/androidx/car/app/model/CarIcon.Builder#setTint(androidx.car.app.model.CarColor)` if needed.

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 `https://developer.android.com/reference/androidx/car/app/model/CarIconStyle.Builder#setTint(androidx.car.app.model.CarColor)` provided to the icon with `https://developer.android.com/reference/androidx/car/app/model/CarIcon.Builder#setStyle(androidx.car.app.model.CarIconStyle)`. Otherwise, a default tint color as determined by the host will be applied.

### IMAGE_TYPE_LARGE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
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_MEDIUM

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
@RequiresCarApi(value = 8)
public static final int IMAGE_TYPE_MEDIUM = 16
```

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

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
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

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
public static final int NO_DECORATION = -1
```

An integer value indicating no decoration should be shown.

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getActions

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
@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 |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#addAction(androidx.car.app.model.Action)` |   |

### getEndImage

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
@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 |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#setEndImage(androidx.car.app.model.CarIcon)` |   |

### getImage

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable CarIcon getImage()
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#setImage(androidx.car.app.model.CarIcon)` |   |
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#setImage(androidx.car.app.model.CarIcon,int)` |   |

### getMetadata

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable Metadata getMetadata()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/Metadata` associated with the row or `null` if there is no metadata associated with the row.

### getNumericDecoration

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
@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.

`https://developer.android.com/reference/androidx/car/app/model/Row#NO_DECORATION()` will be returned if the row does not contain a decoration.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#setNumericDecoration(int)` |   |

### getOnClickDelegate

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable OnClickDelegate getOnClickDelegate()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/OnClickListener` to be called back when the row is clicked or `
null` if the row is non-clickable.

### getProgressBar

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
@RequiresCarApi(value = 9)
@ExperimentalCarApi
public @Nullable CarProgressBar getProgressBar()
```

Returns the progress bar to display in the row, or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#setProgressBar(androidx.car.app.model.CarProgressBar)` |   |

### getRowEndImageType

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
@RequiresCarApi(value = 8)
public int getRowEndImageType()
```

Returns the type of the end image in the row.

### getRowImageType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public int getRowImageType()
```

Returns the type of the image in the row.

### getTexts

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @NonNull List<CarText> getTexts()
```

Returns the list of text below the title.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#addText(java.lang.CharSequence)` |   |

### getTitle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable CarText getTitle()
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#setTitle(java.lang.CharSequence)` |   |

### getToggle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @Nullable Toggle getToggle()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/Toggle` in the row or `null` if the row does not contain a toggle.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#setToggle(androidx.car.app.model.Toggle)` |   |

### hashCode

```
public int hashCode()
```

### isBrowsable

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public boolean isBrowsable()
```

Returns whether the row is browsable.

If a row is browsable, then no `https://developer.android.com/reference/androidx/car/app/model/Action` or `https://developer.android.com/reference/androidx/car/app/model/Toggle` can be added to it.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row#isBrowsable()` |   |

### isEnabled

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
@RequiresCarApi(value = 5)
public boolean isEnabled()
```

Returns `true` if the row is enabled.

### isIndexable

Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)

```
@RequiresCarApi(value = 8)
public boolean isIndexable()
```

Returns whether this item can be included in indexed lists.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/model/Row.Builder#setIndexable(boolean)` |   |

### row

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @NonNull Row row()
```

Returns a `https://developer.android.com/reference/androidx/car/app/model/Row` for rowing `https://developer.android.com/reference/androidx/car/app/model/Row#yourBoat()`

### toString

```
public @NonNull String toString()
```

### yourBoat

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

```
public @NonNull CharSequence yourBoat()
```

Rows your boat.

Example usage:

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