SemanticsKt

Added in 1.3.0-alpha06

public final class SemanticsKt


Summary

Public methods

static final @NonNull LayoutModifier
contentDescription(
    @NonNull LayoutModifier receiver,
    @NonNull String staticValue,
    @RequiresSchemaVersion(major = 1, minor = 200) DynamicBuilders.DynamicString dynamicValue
)

Adds content description to be read by Talkback.

static final @NonNull LayoutModifier
semanticsRole(@NonNull LayoutModifier receiver, int semanticsRole)

Adds the semantic role of user interface element.

Public methods

contentDescription

public static final @NonNull LayoutModifier contentDescription(
    @NonNull LayoutModifier receiver,
    @NonNull String staticValue,
    @RequiresSchemaVersion(major = 1, minor = 200) DynamicBuilders.DynamicString dynamicValue
)

Adds content description to be read by Talkback.

Parameters
@NonNull String staticValue

The static content description. This value will be used if dynamicValue is null, or if can't be resolved.

@RequiresSchemaVersion(major = 1, minor = 200) DynamicBuilders.DynamicString dynamicValue

The dynamic content description. This is useful when content of the element itself is dynamic.

public static final @NonNull LayoutModifier semanticsRole(@NonNull LayoutModifier receiver, int semanticsRole)

Adds the semantic role of user interface element. Accessibility services might use this to describe the element or do customizations.