# PrimaryLayout.Builder

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

*** ** * ** ***


```
class PrimaryLayout.Builder : LayoutElementBuilders.LayoutElement.Builder
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Deprecated in Java

Builder class for `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout`.

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#Builder(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters))(deviceParameters: https://developer.android.com/reference/kotlin/androidx/wear/tiles/DeviceParametersBuilders.DeviceParameters)` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout` | `[build](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#build())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder` | `[setContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(content: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder` | `[setPrimaryChipContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setPrimaryChipContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(compactChip: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder` | `[setPrimaryLabelTextContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setPrimaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))( primaryLabelText: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement )` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder` | `[setSecondaryLabelTextContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setSecondaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))( secondaryLabelText: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement )` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder` | `[setVerticalSpacerHeight](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setVerticalSpacerHeight(float))(height: @https://developer.android.com/reference/kotlin/androidx/annotation/Dimension(unit = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` **This function is deprecated.** Deprecated in Java |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
[Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#Builder(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters))(deviceParameters: DeviceParametersBuilders.DeviceParameters)
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Creates a builder for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout` from the given content. Content inside of it can later be set with `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement)`, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setPrimaryChipContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement)`, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setPrimaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement)` and `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setSecondaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement)`.

## Public functions

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
fun [build](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#build())(): PrimaryLayout
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

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

### setContent

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
fun [setContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(content: LayoutElementBuilders.LayoutElement): PrimaryLayout.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the additional content to this layout, above the primary chip.

The content slot will wrap the elements' height, so the height of the given content must be fixed or set to wrap (`expand` can't be used).

This layout has built-in horizontal margins, so the given content should have width set to `expand` to use all the available space, rather than an explicit width which may lead to clipping.

### setPrimaryChipContent

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
fun [setPrimaryChipContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setPrimaryChipContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(compactChip: LayoutElementBuilders.LayoutElement): PrimaryLayout.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the element which is in the slot at the bottom of the layout. Note that it is accepted to pass in any `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement`, but it is strongly recommended to add a CompactChip as the layout is optimized for it.

### setPrimaryLabelTextContent

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
fun [setPrimaryLabelTextContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setPrimaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(
    primaryLabelText: LayoutElementBuilders.LayoutElement
): PrimaryLayout.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the content in the primary label slot which will be above the main content.

### setSecondaryLabelTextContent

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
fun [setSecondaryLabelTextContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setSecondaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(
    secondaryLabelText: LayoutElementBuilders.LayoutElement
): PrimaryLayout.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the content in the primary label slot which will be below the main content. It is highly recommended to have primary label set when having secondary label.

### setVerticalSpacerHeight

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
fun [setVerticalSpacerHeight](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/PrimaryLayout.Builder#setVerticalSpacerHeight(float))(height: @Dimension(unit = 0) Float): PrimaryLayout.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Sets the vertical spacer height which is used as a space between main content and secondary label if there is any. If not set, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/LayoutDefaults#DEFAULT_VERTICAL_SPACER_HEIGHT()` will be used.