ModifiersBuilders.Semantics.Builder


public final class ModifiersBuilders.Semantics.Builder


Builder for Semantics

Summary

Public constructors

Creates an instance of Builder.

Public methods

@NonNull ModifiersBuilders.Semantics

Builds an instance from accumulated values.

@NonNull ModifiersBuilders.Semantics.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setContentDescription(@NonNull String contentDescription)

Sets the content description associated with this element.

@NonNull ModifiersBuilders.Semantics.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setContentDescription(
    @NonNull TypeBuilders.StringProp contentDescription
)

Sets the content description associated with this element.

@NonNull ModifiersBuilders.Semantics.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setRole(int role)

Sets the type of user interface element.

@NonNull ModifiersBuilders.Semantics.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setStateDescription(@NonNull TypeBuilders.StringProp stateDescription)

Sets the localized state description of the semantics node.

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates an instance of Builder.

Public methods

build

Added in 1.0.0
public @NonNull ModifiersBuilders.Semantics build()

Builds an instance from accumulated values.

setContentDescription

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Semantics.Builder setContentDescription(@NonNull String contentDescription)

Sets the content description associated with this element. This will be dictated when the element is focused by the screen reader.

setContentDescription

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Semantics.Builder setContentDescription(
    @NonNull TypeBuilders.StringProp contentDescription
)

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

setRole

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull ModifiersBuilders.Semantics.Builder setRole(int role)

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

setStateDescription

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull ModifiersBuilders.Semantics.Builder setStateDescription(@NonNull TypeBuilders.StringProp stateDescription)

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