# ComplicationSlot.Builder

Artifact: [androidx.wear.watchface:watchface](https://developer.android.com/jetpack/androidx/releases/wear-watchface) [View Source](https://cs.android.com/search?q=file:androidx/wear/watchface/ComplicationSlot.kt+class:androidx.wear.watchface.ComplicationSlot.Builder) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.0.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

*** ** * ** ***

<br />

```
class ComplicationSlot.Builder
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Builder for constructing `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot`s.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot` | `[build](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#build())()` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder` | `[setAccessibilityTraversalIndex](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setAccessibilityTraversalIndex(kotlin.Int))(accessibilityTraversalIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder` | `[setConfigExtras](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setConfigExtras(android.os.Bundle))(extras: https://developer.android.com/reference/android/os/Bundle.html)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder` | `[setDefaultDataSourceType](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setDefaultDataSourceType(androidx.wear.watchface.complications.data.ComplicationType))(defaultDataSourceType: https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationType)` **This function is deprecated.** Instead set DefaultComplicationDataSourcePolicy.systemDataSourceFallbackDefaultType. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder` | `[setEnabled](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setEnabled(kotlin.Boolean))(enabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder` | `[setFixedComplicationDataSource](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setFixedComplicationDataSource(kotlin.Boolean))(fixedComplicationDataSource: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder` | `[setNameResourceId](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setNameResourceId(kotlin.Int))(nameResourceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html?)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder` | `[setScreenReaderNameResourceId](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setScreenReaderNameResourceId(kotlin.Int))(screenReaderNameResourceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html?)` **This function is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

## Public functions

### build

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

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

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Constructs the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot`.

### setAccessibilityTraversalIndex

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

```
fun [setAccessibilityTraversalIndex](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setAccessibilityTraversalIndex(kotlin.Int))(accessibilityTraversalIndex: Int): ComplicationSlot.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Sets the initial value used to sort Complications when generating accessibility content description labels. By default this is `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#id()`.

### setConfigExtras

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

```
fun [setConfigExtras](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setConfigExtras(android.os.Bundle))(extras: Bundle): ComplicationSlot.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Sets optional extras to be merged into the Intent sent when invoking the complication data source chooser activity.

### setDefaultDataSourceType

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

```
fun [setDefaultDataSourceType](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setDefaultDataSourceType(androidx.wear.watchface.complications.data.ComplicationType))(defaultDataSourceType: ComplicationType): ComplicationSlot.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> Instead set DefaultComplicationDataSourcePolicy.systemDataSourceFallbackDefaultType.

Sets the initial `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/data/ComplicationType` to use with the initial complication data source. Note care should be taken to ensure `https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setDefaultDataSourceType(androidx.wear.watchface.complications.data.ComplicationType)` is compatible with the `https://developer.android.com/reference/kotlin/androidx/wear/watchface/complications/DefaultComplicationDataSourcePolicy`.

### setEnabled

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

```
fun [setEnabled](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setEnabled(kotlin.Boolean))(enabled: Boolean): ComplicationSlot.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Whether the complication is initially enabled or not (by default its enabled). This can be overridden by `https://developer.android.com/reference/kotlin/androidx/wear/watchface/style/UserStyleSetting.ComplicationSlotsUserStyleSetting`.

### setFixedComplicationDataSource

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

```
fun [setFixedComplicationDataSource](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setFixedComplicationDataSource(kotlin.Boolean))(fixedComplicationDataSource: Boolean): ComplicationSlot.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

Whether or not the complication source is fixed (i.e. the user can't change it).

### setNameResourceId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
fun [setNameResourceId](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setNameResourceId(kotlin.Int))(nameResourceId: Int?): ComplicationSlot.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

If non-null sets the ID of a string resource containing the name of this complication slot, for use visually in an editor. This resource should be short and should not contain the word "Complication". E.g. "Left" for the left complication.

### setScreenReaderNameResourceId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.1.0) Deprecated in [1.3.0-alpha07](https://developer.android.com/jetpack/androidx/releases/wear-watchface#1.3.0-alpha07)

```
fun [setScreenReaderNameResourceId](https://developer.android.com/reference/kotlin/androidx/wear/watchface/ComplicationSlot.Builder#setScreenReaderNameResourceId(kotlin.Int))(screenReaderNameResourceId: Int?): ComplicationSlot.Builder
```

> [!CAUTION]
> **This function is deprecated.**   
> AndroidX watchface libraries are deprecated, use Watch Face Format instead. For more info see: https://developer.android.com/training/wearables/wff

If non-null sets the ID of a string resource containing the name of this complication slot, for use by a screen reader. This resource should be a short sentence. E.g. "Left complication" for the left complication.