ModifiersBuilders.Semantics


@RequiresSchemaVersion(major = 1, minor = 0)
class ModifiersBuilders.Semantics


A modifier for an element which has accessibility semantics associated with it. This should generally be used sparingly, and in most cases should only be applied to the top-level layout element or to Clickables.

Summary

Nested types

Builder for Semantics

Public functions

TypeBuilders.StringProp?

Gets the content description associated with this element.

Int

Gets the type of user interface element.

TypeBuilders.StringProp?

Gets the localized state description of the semantics node.

String

Public functions

getContentDescription

Added in 1.0.0
fun getContentDescription(): TypeBuilders.StringProp?

Gets 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).

getRole

Added in 1.0.0
fun getRole(): Int

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

getStateDescription

Added in 1.0.0
fun getStateDescription(): TypeBuilders.StringProp?

Gets 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).

toString

fun toString(): String