Android 12 Developer Preview is here! Try it out, and give us your feedback!

AccessibilityAction

class AccessibilityAction<T : Function<Boolean>>
kotlin.Any
   ↳ androidx.compose.ui.semantics.AccessibilityAction

Standard accessibility action.

Summary

Public constructors
<init>(label: String?, action: T?)

Standard accessibility action.

Public methods
Boolean
equals(other: Any?)

Int

String

Properties
T?

The function to invoke when this action is performed.

String?

The description of this action

Public constructors

<init>

AccessibilityAction(
    label: String?,
    action: T?)

Standard accessibility action.

Parameters
label: String? The description of this action
action: T? The function to invoke when this action is performed. The function should return a boolean result indicating whether the action is successfully handled. For example, a scroll forward action should return false if the widget is not enabled or has reached the end of the list. If multiple semantics blocks with the same AccessibilityAction are provided, the resulting AccessibilityAction's label/action will be the label/action of the outermost modifier with this key and nonnull label/action, or null if no nonnull label/action is found.

Public methods

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

toString

fun toString(): String

Properties

action

val action: T?

The function to invoke when this action is performed. The function should return a boolean result indicating whether the action is successfully handled. For example, a scroll forward action should return false if the widget is not enabled or has reached the end of the list. If multiple semantics blocks with the same AccessibilityAction are provided, the resulting AccessibilityAction's label/action will be the label/action of the outermost modifier with this key and nonnull label/action, or null if no nonnull label/action is found.

label

val label: String?

The description of this action