# Text.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/Text.java+class:androidx.wear.tiles.material.Text.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 Text.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/Text`.

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#Builder(android.content.Context,java.lang.String))(context: https://developer.android.com/reference/android/content/Context.html, text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text` | `[build](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#build())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder` | `[setColor](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setColor(androidx.wear.tiles.ColorBuilders.ColorProp))(color: https://developer.android.com/reference/kotlin/androidx/wear/tiles/ColorBuilders.ColorProp)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder` | `[setItalic](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setItalic(boolean))(italic: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder` | `[setMaxLines](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/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/material/Text.Builder` | `[setModifiers](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/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/material/Text.Builder` | `[setMultilineAlignment](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/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/material/Text.Builder` | `[setOverflow](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/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/material/Text.Builder` | `[setTypography](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setTypography(int))(typography: 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/material/Text.Builder` | `[setUnderline](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setUnderline(boolean))(underline: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder` | `[setWeight](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setWeight(int))(weight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/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/Text.Builder#Builder(android.content.Context,java.lang.String))(context: Context, text: String)
```

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

Creates a builder for `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text`.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | The application's context. |
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The text content for this component. |

## 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/Text.Builder#build())(): Text
```

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

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

### setColor

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 [setColor](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setColor(androidx.wear.tiles.ColorBuilders.ColorProp))(color: ColorBuilders.ColorProp): Text.Builder
```

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

Sets the color for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text`. If not set, onPrimary color from the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Colors#DEFAULT()` will be used.

### setItalic

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 [setItalic](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setItalic(boolean))(italic: Boolean): Text.Builder
```

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

Sets the text to be italic. If not set, false will be used.

### setMaxLines

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 [setMaxLines](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setMaxLines(int))(maxLines: @IntRange(from = 1) Int): Text.Builder
```

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

Sets the maximum lines of text. If not set, 1 will be used.

### setModifiers

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 [setModifiers](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers))(modifiers: ModifiersBuilders.Modifiers): Text.Builder
```

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

Sets the modifiers of text.

### setMultilineAlignment

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 [setMultilineAlignment](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setMultilineAlignment(int))(multilineAlignment: Int): Text.Builder
```

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

Sets the multiline alignment for text within bounds of the Text element. Note that this option has no effect for single line of text, and for that, alignment on the outer container should be used. If not set, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders#TEXT_ALIGN_CENTER()` will be used.

### setOverflow

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 [setOverflow](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setOverflow(int))(overflow: Int): Text.Builder
```

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

Sets the overflow for text. If not set, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders#TEXT_OVERFLOW_ELLIPSIZE_END()` will be used.

### setTypography

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 [setTypography](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setTypography(int))(typography: Int): Text.Builder
```

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

Sets the typography for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text`. If not set, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Typography#TYPOGRAPHY_DISPLAY1()` will be used.

### setUnderline

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 [setUnderline](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setUnderline(boolean))(underline: Boolean): Text.Builder
```

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

Sets the text to be underlined. If not set, false will be used.

### setWeight

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 [setWeight](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Text.Builder#setWeight(int))(weight: Int): Text.Builder
```

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

Sets the weight of the font. If not set, default weight for the chosen Typography will be used.