# LayoutElementBuilders.Row.Builder

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

*** ** * ** ***


```
public final class LayoutElementBuilders.Row.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder#Builder()()` Creates an instance of `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder#addContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement content)` Adds one item to the list of child elements to place inside this `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row` | `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder#build()()` Builds an instance from accumulated values. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder#setHeight(androidx.wear.protolayout.DimensionBuilders.ContainerDimension)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DimensionBuilders.ContainerDimension height)` Sets the height of this row. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder#setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Modifiers modifiers)` Sets `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Modifiers` for this element. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder#setVerticalAlignment(int)(int verticalAlignment)` Sets the vertical alignment of elements inside this row, if they are narrower than the resulting height of the row. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder#setVerticalAlignment(androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.VerticalAlignmentProp verticalAlignment )` Sets the vertical alignment of elements inside this row, if they are narrower than the resulting height of the row. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder#setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/DimensionBuilders.ContainerDimension width)` Sets the width of this row. |

## Public constructors

### Builder

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

```
public Builder()
```

Creates an instance of `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row.Builder`.

## Public methods

### addContent

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Row.Builder addContent(@NonNull LayoutElementBuilders.LayoutElement content)
```

Adds one item to the list of child elements to place inside this `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Row`.

### build

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

```
public @NonNull LayoutElementBuilders.Row build()
```

Builds an instance from accumulated values.

### setHeight

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Row.Builder setHeight(@NonNull DimensionBuilders.ContainerDimension height)
```

Sets the height of this row. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).

### setModifiers

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Row.Builder setModifiers(@NonNull ModifiersBuilders.Modifiers modifiers)
```

Sets `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Modifiers` for this element.

### setVerticalAlignment

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Row.Builder setVerticalAlignment(int verticalAlignment)
```

Sets the vertical alignment of elements inside this row, if they are narrower than the resulting height of the row. If not defined, defaults to VERTICAL_ALIGN_CENTER.

### setVerticalAlignment

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Row.Builder setVerticalAlignment(
    @NonNull LayoutElementBuilders.VerticalAlignmentProp verticalAlignment
)
```

Sets the vertical alignment of elements inside this row, if they are narrower than the resulting height of the row. If not defined, defaults to VERTICAL_ALIGN_CENTER.

### setWidth

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Row.Builder setWidth(@NonNull DimensionBuilders.ContainerDimension width)
```

Sets the width of this row. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).