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

```
public final 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/androidx/wear/watchface/ComplicationSlot`s.

## Summary

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot` | `[build](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#build())()` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder` | `[setAccessibilityTraversalIndex](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setAccessibilityTraversalIndex(kotlin.Int))(int accessibilityTraversalIndex)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder` | `[setConfigExtras](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setConfigExtras(android.os.Bundle))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html extras)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder` | `[setDefaultDataSourceType](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setDefaultDataSourceType(androidx.wear.watchface.complications.data.ComplicationType))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/complications/data/ComplicationType defaultDataSourceType )` **This method is deprecated.** Instead set DefaultComplicationDataSourcePolicy.systemDataSourceFallbackDefaultType. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder` | `[setEnabled](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setEnabled(kotlin.Boolean))(boolean enabled)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder` | `[setFixedComplicationDataSource](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setFixedComplicationDataSource(kotlin.Boolean))(boolean fixedComplicationDataSource)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder` | `[setNameResourceId](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setNameResourceId(kotlin.Int))(https://developer.android.com/reference/java/lang/Integer.html nameResourceId)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder` | `[setScreenReaderNameResourceId](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setScreenReaderNameResourceId(kotlin.Int))(https://developer.android.com/reference/java/lang/Integer.html screenReaderNameResourceId)` **This method is deprecated.** AndroidX watchface libraries are deprecated, use Watch Face Format instead. |

## Public methods

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

```
public final @NonNull ComplicationSlot [build](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#build())()
```

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

```
public final @NonNull ComplicationSlot.Builder [setAccessibilityTraversalIndex](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setAccessibilityTraversalIndex(kotlin.Int))(int accessibilityTraversalIndex)
```

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

```
public final @NonNull ComplicationSlot.Builder [setConfigExtras](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setConfigExtras(android.os.Bundle))(@NonNull Bundle extras)
```

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

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

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

Sets the initial `https://developer.android.com/reference/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/androidx/wear/watchface/ComplicationSlot.Builder#setDefaultDataSourceType(androidx.wear.watchface.complications.data.ComplicationType)` is compatible with the `https://developer.android.com/reference/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)

```
public final @NonNull ComplicationSlot.Builder [setEnabled](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setEnabled(kotlin.Boolean))(boolean enabled)
```

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

```
public final @NonNull ComplicationSlot.Builder [setFixedComplicationDataSource](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setFixedComplicationDataSource(kotlin.Boolean))(boolean fixedComplicationDataSource)
```

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

```
public final @NonNull ComplicationSlot.Builder [setNameResourceId](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setNameResourceId(kotlin.Int))(Integer nameResourceId)
```

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

```
public final @NonNull ComplicationSlot.Builder [setScreenReaderNameResourceId](https://developer.android.com/reference/androidx/wear/watchface/ComplicationSlot.Builder#setScreenReaderNameResourceId(kotlin.Int))(Integer screenReaderNameResourceId)
```

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