# MultiSlotLayout.Builder

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

*** ** * ** ***


```
public final class MultiSlotLayout.Builder
```

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout.Builder#Builder()()` Creates a builder for the `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout.Builder` | `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout.Builder#addSlotContent(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 slotContent)` Add one new slot to the layout with the given content inside. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout` | `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout.Builder#build()()` Constructs and returns `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout` with the provided content and look. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout.Builder` | `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout.Builder#setHorizontalSpacerWidth(float)(@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float width)` Sets the horizontal spacer width which is used as a space between slots if there is more than one slot. |

## Public constructors

### Builder

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

```
public Builder()
```

Creates a builder for the `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout`. Content inside of it can later be added with `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout.Builder#addSlotContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement)`.

## Public methods

### addSlotContent

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

```
public @NonNull MultiSlotLayout.Builder addSlotContent(@NonNull LayoutElementBuilders.LayoutElement slotContent)
```

Add one new slot to the layout with the given content inside.

### build

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

```
public @NonNull MultiSlotLayout build()
```

Constructs and returns `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout` with the provided content and look.

### setHorizontalSpacerWidth

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

```
public @NonNull MultiSlotLayout.Builder setHorizontalSpacerWidth(@Dimension(unit = 0) float width)
```

Sets the horizontal spacer width which is used as a space between slots if there is more than one slot. If not set, `https://developer.android.com/reference/androidx/wear/protolayout/material/layouts/LayoutDefaults#MULTI_SLOT_LAYOUT_HORIZONTAL_SPACER_WIDTH()` will be used.