SemanticsKt
public final class SemanticsKt
Summary
Public methods |
|
|---|---|
static final @NonNull LayoutModifier |
clearSemantics(@NonNull LayoutModifier receiver)Clears the semantics, including |
static final @NonNull LayoutModifier |
contentDescription(Adds content description to be read by accessibility services. |
static final @NonNull LayoutModifier |
@RequiresSchemaVersion(major = 1, minor = 600)Mark the element as heading for a section of content for accessibility purpose. |
static final @NonNull LayoutModifier |
semanticsRole(@NonNull LayoutModifier receiver, int semanticsRole)Adds the semantic role of user interface element. |
Public methods
clearSemantics
public static final @NonNull LayoutModifier clearSemantics(@NonNull LayoutModifier receiver)
Clears the semantics, including contentDescription and semanticsRole, from the modifier.
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 accessibility services.
| Parameters | |
|---|---|
@NonNull String staticValue |
The static content description. This value will be used if |
@RequiresSchemaVersion(major = 1, minor = 200) DynamicBuilders.DynamicString dynamicValue |
The dynamic content description. This is useful when content of the element itself is dynamic. |
semanticsHeading
@RequiresSchemaVersion(major = 1, minor = 600)
public static final @NonNull LayoutModifier semanticsHeading(@NonNull LayoutModifier receiver, boolean heading)
Mark the element as heading for a section of content for accessibility purpose.
semanticsRole
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.