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

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#Builder(android.content.Context,androidx.wear.tiles.ModifiersBuilders.Clickable,androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters))( context: https://developer.android.com/reference/android/content/Context.html, clickable: https://developer.android.com/reference/kotlin/androidx/wear/tiles/ModifiersBuilders.Clickable, 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/Chip` | `[build](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#build())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder` | `[setChipColors](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setChipColors(androidx.wear.tiles.material.ChipColors))(chipColors: https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ChipColors)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder` | `[setContentDescription](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setContentDescription(java.lang.CharSequence))(contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder` | `[setCustomContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setCustomContent(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/Chip.Builder` | `[setHorizontalAlignment](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setHorizontalAlignment(int))(horizontalAlignment: 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/Chip.Builder` | `[setIconContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setIconContent(java.lang.String))(imageResourceId: 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/material/Chip.Builder` | `[setPrimaryLabelContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setPrimaryLabelContent(java.lang.String))(primaryLabel: 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/material/Chip.Builder` | `[setSecondaryLabelContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setSecondaryLabelContent(java.lang.String))(secondaryLabel: 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/material/Chip.Builder` | `[setWidth](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension))(width: https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.ContainerDimension)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder` | `[setWidth](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setWidth(float))(width: @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/Chip.Builder#Builder(android.content.Context,androidx.wear.tiles.ModifiersBuilders.Clickable,androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters))(
    context: Context,
    clickable: ModifiersBuilders.Clickable,
    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/Chip` with associated action. It is required to add content later with setters.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | The application's context. |
| `clickable: https://developer.android.com/reference/kotlin/androidx/wear/tiles/ModifiersBuilders.Clickable` | Associated Clickable for click events. When the Chip is clicked it will fire the associated action. |
| `deviceParameters: https://developer.android.com/reference/kotlin/androidx/wear/tiles/DeviceParametersBuilders.DeviceParameters` | The device parameters used to derive defaults for this Chip. |

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

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

Constructs and returns `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip` 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)

```
fun [setChipColors](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setChipColors(androidx.wear.tiles.material.ChipColors))(chipColors: ChipColors): Chip.Builder
```

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

Sets the colors for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip`. If set, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ChipColors#getBackgroundColor()` will be used for the background of the button, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ChipColors#getContentColor()` for main text, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ChipColors#getSecondaryContentColor()` for label text and `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ChipColors#getIconColor()` will be used as color for the icon itself. If not set, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ChipDefaults#PRIMARY_COLORS()` will be used.

### setContentDescription

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 [setContentDescription](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setContentDescription(java.lang.CharSequence))(contentDescription: CharSequence): Chip.Builder
```

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

Sets the content description for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip`. It is highly recommended to provide this for chip containing icon.

### setCustomContent

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 [setCustomContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setCustomContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(content: LayoutElementBuilders.LayoutElement): Chip.Builder
```

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

Sets the custom content for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip`. Any previously added content will be overridden.

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

```
fun [setHorizontalAlignment](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setHorizontalAlignment(int))(horizontalAlignment: Int): Chip.Builder
```

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

Sets the horizontal alignment in the chip. It is strongly recommended that the content of the chip is start-aligned if there is more than primary text in it. By default, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders#HORIZONTAL_ALIGN_CENTER()` will be used when only a primary label is present. Otherwise `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders#HORIZONTAL_ALIGN_START()` will be used.

### setIconContent

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 [setIconContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setIconContent(java.lang.String))(imageResourceId: String): Chip.Builder
```

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

Sets the icon for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip`. Any previously added custom content will be overridden. Provided icon will be tinted to the given content color from `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ChipColors`. This icon should be image with chosen alpha channel and not an actual image. If icon is set, primary label must be set too with `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setPrimaryLabelContent(java.lang.String)`.

### setPrimaryLabelContent

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 [setPrimaryLabelContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setPrimaryLabelContent(java.lang.String))(primaryLabel: String): Chip.Builder
```

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

Sets the primary label for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip`. Any previously added custom content will be overridden. Primary label can be on 1 or 2 lines, depending on the length and existence of secondary label.

### setSecondaryLabelContent

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 [setSecondaryLabelContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setSecondaryLabelContent(java.lang.String))(secondaryLabel: String): Chip.Builder
```

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

Sets the secondary label for the `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip`. Any previously added custom content will be overridden. If secondary label is set, primary label must be set too with `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setPrimaryLabelContent(java.lang.String)`.

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

```
fun [setWidth](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip.Builder#setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension))(width: DimensionBuilders.ContainerDimension): Chip.Builder
```

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

Sets the width of `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/Chip`. 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)

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

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

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