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 |
|---|
public final class ModifiersBuilders.Semantics.BuilderBuilder for |
Public methods |
|
|---|---|
@Nullable TypeBuilders.StringProp |
Gets the content description associated with this element. |
int |
getRole()Gets the type of user interface element. |
@Nullable TypeBuilders.StringProp |
Gets the localized state description of the semantics node. |
boolean |
Gets whether this element should be marked as heading for accessibility. |
@NonNull String |
toString() |
Public methods
getContentDescription
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
public int getRole()
Gets the type of user interface element. Accessibility services might use this to describe the element or do customizations.
getStateDescription
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).
isHeading
public boolean isHeading()
Gets whether this element should be marked as heading for accessibility.