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

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#Builder(android.content.Context,java.lang.String,androidx.wear.tiles.ModifiersBuilders.Clickable,androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters))( @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, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/ModifiersBuilders.Clickable clickable, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/DeviceParametersBuilders.DeviceParameters deviceParameters )` **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/TitleChip` | `[build](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.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/TitleChip.Builder` | `[setChipColors](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#setChipColors(androidx.wear.tiles.material.ChipColors))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/ChipColors chipColors)` **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/TitleChip.Builder` | `[setHorizontalAlignment](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#setHorizontalAlignment(int))(int horizontalAlignment)` **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/TitleChip.Builder` | `[setWidth](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/DimensionBuilders.ContainerDimension width)` **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/TitleChip.Builder` | `[setWidth](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#setWidth(float))(@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float width)` **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/TitleChip.Builder#Builder(android.content.Context,java.lang.String,androidx.wear.tiles.ModifiersBuilders.Clickable,androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters))(
    @NonNull Context context,
    @NonNull String text,
    @NonNull ModifiersBuilders.Clickable clickable,
    @NonNull DeviceParametersBuilders.DeviceParameters deviceParameters
)
```

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

Creates a builder for the `https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip` with associated action and the given 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 to be displayed in this title chip. Text will be displayed in 1 line and truncated if it doesn't fit. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/ModifiersBuilders.Clickable clickable` | Associated Clickable for click events. When the TitleChip is clicked it will fire the associated action. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/DeviceParametersBuilders.DeviceParameters deviceParameters` | The device parameters used for styling text. |

## 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 TitleChip [build](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#build())()
```

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

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

### setChipColors

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 TitleChip.Builder [setChipColors](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#setChipColors(androidx.wear.tiles.material.ChipColors))(@NonNull ChipColors chipColors)
```

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

Sets the colors for the `https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip`. If set, `https://developer.android.com/reference/androidx/wear/tiles/material/ChipColors#getBackgroundColor()` will be used for the background of the button and `https://developer.android.com/reference/androidx/wear/tiles/material/ChipColors#getContentColor()` for the text. If not set, `https://developer.android.com/reference/androidx/wear/tiles/material/ChipDefaults#TITLE_PRIMARY_COLORS()` will be used.

### setHorizontalAlignment

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 TitleChip.Builder [setHorizontalAlignment](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#setHorizontalAlignment(int))(int horizontalAlignment)
```

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

Sets the horizontal alignment in the chip. If not set, content will be centered.

### setWidth

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 TitleChip.Builder [setWidth](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension))(@NonNull DimensionBuilders.ContainerDimension width)
```

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

Sets the width of `https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip`. If not set, default value will be set to fill the screen.

### setWidth

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 TitleChip.Builder [setWidth](https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip.Builder#setWidth(float))(@Dimension(unit = 0) float width)
```

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

Sets the width of `https://developer.android.com/reference/androidx/wear/tiles/material/TitleChip`. If not set, default value will be set to fill the screen.