# ModifiersBuilders.Semantics.Builder

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/ModifiersBuilders.java+class:androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***


```
class ModifiersBuilders.Semantics.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#Builder()()` Creates an instance of `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics` | `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#build()()` Builds an instance from accumulated values. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setContentDescription(java.lang.String)(contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Sets the content description associated with this element. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp)(contentDescription: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.StringProp)` Sets the content description associated with this element. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 600) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setHeading(boolean)(heading: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether this element should be marked as heading for accessibility. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setRole(int)(role: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the type of user interface element. |
| `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setStateDescription(androidx.wear.protolayout.TypeBuilders.StringProp)(stateDescription: https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.StringProp)` Sets the localized state description of the semantics node. |

## Public constructors

### Builder

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

```
Builder()
```

Creates an instance of `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder`.

## Public functions

### build

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

```
fun build(): ModifiersBuilders.Semantics
```

Builds an instance from accumulated values.

### setContentDescription

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
fun setContentDescription(contentDescription: String): ModifiersBuilders.Semantics.Builder
```

Sets the content description associated with this element. This will be dictated when the element is focused by the screen reader.

### setContentDescription

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
fun setContentDescription(contentDescription: TypeBuilders.StringProp): ModifiersBuilders.Semantics.Builder
```

Sets the content description associated with this element. This will be dictated when the element is focused by the screen reader.

While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).

### setHeading

Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 600)
fun setHeading(heading: Boolean): ModifiersBuilders.Semantics.Builder
```

Sets whether this element should be marked as heading for accessibility. Defaults to false.

### setRole

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun setRole(role: Int): ModifiersBuilders.Semantics.Builder
```

Sets the type of user interface element. Accessibility services might use this to describe the element or do customizations.

### setStateDescription

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun setStateDescription(stateDescription: TypeBuilders.StringProp): ModifiersBuilders.Semantics.Builder
```

Sets the localized state description of the semantics node. For example: "on" or "off". This will be dictated when the element is focused by the screen reader.

This field is bindable and will use the dynamic value (if set).