# LayoutElementBuilders.Text.Builder

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

*** ** * ** ***


```
class LayoutElementBuilders.Text.Builder : LayoutElementBuilders.LayoutElement.Builder
```

<br />

*** ** * ** ***

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

Builder for `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text`.

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#Builder())()` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` | `[build](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#build())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setFontStyle](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle))(fontStyle: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.FontStyle)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setLineHeight](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp))(lineHeight: https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.SpProp)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setMaxLines](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setMaxLines(int))(maxLines: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setMaxLines](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop))(maxLines: https://developer.android.com/reference/kotlin/androidx/wear/tiles/TypeBuilders.Int32Prop)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setModifiers](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers))(modifiers: https://developer.android.com/reference/kotlin/androidx/wear/tiles/ModifiersBuilders.Modifiers)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setMultilineAlignment](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setMultilineAlignment(int))(multilineAlignment: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setMultilineAlignment](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp))( multilineAlignment: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.TextAlignmentProp )` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setOverflow](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setOverflow(int))(overflow: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setOverflow](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp))(overflow: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.TextOverflowProp)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setText](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setText(java.lang.String))(text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder` | `[setText](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setText(androidx.wear.tiles.TypeBuilders.StringProp))(text: https://developer.android.com/reference/kotlin/androidx/wear/tiles/TypeBuilders.StringProp)` **This function is deprecated.** Deprecated in Java |

## Public constructors

### Builder

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.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/LayoutElementBuilders.Text.Builder#Builder())()
```

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

## Public functions

### build

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

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

Builds an instance with values accumulated in this Builder.

### setFontStyle

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

```
fun [setFontStyle](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle))(fontStyle: LayoutElementBuilders.FontStyle): LayoutElementBuilders.Text.Builder
```

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

Sets the style of font to use (size, bold etc). If not specified, defaults to the platform's default body font.

### setLineHeight

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

```
fun [setLineHeight](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp))(lineHeight: DimensionBuilders.SpProp): LayoutElementBuilders.Text.Builder
```

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

Sets the explicit height between lines of text. This is equivalent to the vertical distance between subsequent baselines. If not specified, defaults the font's recommended interline spacing.

### setMaxLines

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

```
fun [setMaxLines](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setMaxLines(int))(maxLines: @IntRange(from = 1) Int): LayoutElementBuilders.Text.Builder
```

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

Sets the maximum number of lines that can be represented by the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element. If not defined, the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element will be treated as a single-line element.

### setMaxLines

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

```
fun [setMaxLines](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop))(maxLines: TypeBuilders.Int32Prop): LayoutElementBuilders.Text.Builder
```

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

Sets the maximum number of lines that can be represented by the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element. If not defined, the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element will be treated as a single-line element.

### setModifiers

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

```
fun [setModifiers](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers))(modifiers: ModifiersBuilders.Modifiers): LayoutElementBuilders.Text.Builder
```

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

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

### setMultilineAlignment

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

```
fun [setMultilineAlignment](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setMultilineAlignment(int))(multilineAlignment: Int): LayoutElementBuilders.Text.Builder
```

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

Sets alignment of the text within its bounds. Note that a `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element will size itself to wrap its contents, so this option is meaningless for single-line text (for that, use alignment of the outer container). For multi-line text, however, this will set the alignment of lines relative to the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element bounds. If not defined, defaults to TEXT_ALIGN_CENTER.

### setMultilineAlignment

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

```
fun [setMultilineAlignment](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp))(
    multilineAlignment: LayoutElementBuilders.TextAlignmentProp
): LayoutElementBuilders.Text.Builder
```

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

Sets alignment of the text within its bounds. Note that a `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element will size itself to wrap its contents, so this option is meaningless for single-line text (for that, use alignment of the outer container). For multi-line text, however, this will set the alignment of lines relative to the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element bounds. If not defined, defaults to TEXT_ALIGN_CENTER.

### setOverflow

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

```
fun [setOverflow](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setOverflow(int))(overflow: Int): LayoutElementBuilders.Text.Builder
```

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

Sets how to handle text which overflows the bound of the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element. A `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element will grow as large as possible inside its parent container (while still respecting max_lines); if it cannot grow large enough to render all of its text, the text which cannot fit inside its container will be truncated. If not defined, defaults to TEXT_OVERFLOW_TRUNCATE.

### setOverflow

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

```
fun [setOverflow](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp))(overflow: LayoutElementBuilders.TextOverflowProp): LayoutElementBuilders.Text.Builder
```

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

Sets how to handle text which overflows the bound of the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element. A `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text` element will grow as large as possible inside its parent container (while still respecting max_lines); if it cannot grow large enough to render all of its text, the text which cannot fit inside its container will be truncated. If not defined, defaults to TEXT_OVERFLOW_TRUNCATE.

### setText

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

```
fun [setText](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setText(java.lang.String))(text: String): LayoutElementBuilders.Text.Builder
```

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

Sets the text to render.

### setText

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

```
fun [setText](https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.Text.Builder#setText(androidx.wear.tiles.TypeBuilders.StringProp))(text: TypeBuilders.StringProp): LayoutElementBuilders.Text.Builder
```

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

Sets the text to render.