ModifiersBuilders.Semantics


@RequiresSchemaVersion(major = 1, minor = 0)
public final 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 methods

@Nullable TypeBuilders.StringProp

Gets the content description associated with this element.

int

Gets the type of user interface element.

@Nullable TypeBuilders.StringProp

Gets the localized state description of the semantics node.

@NonNull String

Public methods

getContentDescription

Added in 1.0.0
public @Nullable TypeBuilders.StringProp getContentDescription()

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
public int getRole()

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
public @Nullable TypeBuilders.StringProp getStateDescription()

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

public @NonNull String toString()