# 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)

*** ** * ** ***


```
public final class Text.Builder implements LayoutElementBuilders.LayoutElement.Builder
```

<br />

*** ** * ** ***

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

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

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#Builder(android.content.Context,java.lang.String))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html text)` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text` | `[build](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#build())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setColor](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setColor(androidx.wear.tiles.ColorBuilders.ColorProp))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/ColorBuilders.ColorProp color)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setItalic](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setItalic(boolean))(boolean italic)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setMaxLines](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setMaxLines(int))(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 1) int maxLines)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setModifiers](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/ModifiersBuilders.Modifiers modifiers)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setMultilineAlignment](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setMultilineAlignment(int))(int multilineAlignment)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setOverflow](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setOverflow(int))(int overflow)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setTypography](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setTypography(int))(int typography)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setUnderline](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setUnderline(boolean))(boolean underline)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder` | `[setWeight](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setWeight(int))(int weight)` **This method 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)

```
public [Builder](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#Builder(android.content.Context,java.lang.String))(@NonNull Context context, @NonNull String text)
```

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

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | The application's context. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html text` | The text content for this component. |

## Public methods

### 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)

```
public @NonNull Text [build](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#build())()
```

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

Constructs and returns `https://developer.android.com/reference/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)

```
public @NonNull Text.Builder [setColor](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setColor(androidx.wear.tiles.ColorBuilders.ColorProp))(@NonNull ColorBuilders.ColorProp color)
```

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

Sets the color for the `https://developer.android.com/reference/androidx/wear/tiles/material/Text`. If not set, onPrimary color from the `https://developer.android.com/reference/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)

```
public @NonNull Text.Builder [setItalic](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setItalic(boolean))(boolean italic)
```

> [!CAUTION]
> **This method 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)

```
public @NonNull Text.Builder [setMaxLines](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setMaxLines(int))(@IntRange(from = 1) int maxLines)
```

> [!CAUTION]
> **This method 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)

```
public @NonNull Text.Builder [setModifiers](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers))(@NonNull ModifiersBuilders.Modifiers modifiers)
```

> [!CAUTION]
> **This method 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)

```
public @NonNull Text.Builder [setMultilineAlignment](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setMultilineAlignment(int))(int multilineAlignment)
```

> [!CAUTION]
> **This method 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/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)

```
public @NonNull Text.Builder [setOverflow](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setOverflow(int))(int overflow)
```

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

Sets the overflow for text. If not set, `https://developer.android.com/reference/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)

```
public @NonNull Text.Builder [setTypography](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setTypography(int))(int typography)
```

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

Sets the typography for the `https://developer.android.com/reference/androidx/wear/tiles/material/Text`. If not set, `https://developer.android.com/reference/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)

```
public @NonNull Text.Builder [setUnderline](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setUnderline(boolean))(boolean underline)
```

> [!CAUTION]
> **This method 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)

```
public @NonNull Text.Builder [setWeight](https://developer.android.com/reference/androidx/wear/tiles/material/Text.Builder#setWeight(int))(int weight)
```

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

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