Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

AccessibilityActionCompat

open class AccessibilityActionCompat
kotlin.Any
   ↳ androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat

A class defining an action that can be performed on an AccessibilityNodeInfo. Each action has a unique id and a label.

There are three categories of actions:

  • Standard actions - These are actions that are reported and handled by the standard UI widgets in the platform. For each standard action there is a static constant defined in this class, e.g. ACTION_FOCUS. These actions will have null labels.
  • Custom actions action - These are actions that are reported and handled by custom widgets. i.e. ones that are not part of the UI toolkit. For example, an application may define a custom action for clearing the user history.
  • Overriden standard actions - These are actions that override standard actions to customize them. For example, an app may add a label to the standard ACTION_CLICK action to indicate to the user that this action clears browsing history.

Note: Views which support these actions should invoke View#setImportantForAccessibility(int) with View#IMPORTANT_FOR_ACCESSIBILITY_YES to ensure an android.accessibilityservice.AccessibilityService can discover the set of supported actions.

Summary

Public constructors

<init>(actionId: Int, label: CharSequence!)

Creates a new instance.

Public methods

open Boolean
equals(@Nullable other: Any?)

open Int

Gets the id for this action.

open CharSequence!

Gets the label for this action.

open Int

Properties

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that gives accessibility focus to the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that clears accessibility focus of the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that clears input focus of the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that deselects the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that clicks on the node info.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to collapse an expandable node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that context clicks the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to copy the current selection to the clipboard.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to cut the current selection and place it to the clipboard.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to dismiss a dismissable node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to expand an expandable node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that gives input focus to the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to hide a tooltip.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that long clicks on the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to move a window to a new location.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that requests to go to the next entity in this node's text at a given movement granularity.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to move to the next HTML element of a given type.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat

Action to move to the page below.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat

Action to move to the page left.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat

Action to move to the page right.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat

Action to move to the page above.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to paste the current clipboard content.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that requests to go to the previous entity in this node's text at a given movement granularity.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to move to the previous HTML element of a given type.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content backward.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content down.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content forward.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content left.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content right.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that scrolls the node to make the specified collection position visible on screen.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content up.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that selects the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that sets progress between RangeInfo.getMin() and RangeInfo.getMax().

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to set the selection.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that sets the text of the node.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that requests the node make its bounding rectangle visible on the screen, scrolling if necessary just enough.

static AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to show a tooltip.

Public constructors

<init>

AccessibilityActionCompat(actionId: Int, label: CharSequence!)

Creates a new instance.

Parameters
actionId Int: The action id.
label Int: The action label.

Public methods

equals

open fun equals(@Nullable other: Any?): Boolean

getId

open fun getId(): Int

Gets the id for this action.

Return
Int: The action id.

getLabel

open fun getLabel(): CharSequence!

Gets the label for this action. Its purpose is to describe the action to user.

Return
CharSequence!: The label.

hashCode

open fun hashCode(): Int

Properties

ACTION_ACCESSIBILITY_FOCUS

static val ACTION_ACCESSIBILITY_FOCUS: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that gives accessibility focus to the node.

ACTION_CLEAR_ACCESSIBILITY_FOCUS

static val ACTION_CLEAR_ACCESSIBILITY_FOCUS: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that clears accessibility focus of the node.

ACTION_CLEAR_FOCUS

static val ACTION_CLEAR_FOCUS: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that clears input focus of the node.

ACTION_CLEAR_SELECTION

static val ACTION_CLEAR_SELECTION: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that deselects the node.

ACTION_CLICK

static val ACTION_CLICK: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that clicks on the node info.

ACTION_COLLAPSE

static val ACTION_COLLAPSE: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to collapse an expandable node.

ACTION_CONTEXT_CLICK

static val ACTION_CONTEXT_CLICK: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that context clicks the node.

ACTION_COPY

static val ACTION_COPY: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to copy the current selection to the clipboard.

ACTION_CUT

static val ACTION_CUT: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to cut the current selection and place it to the clipboard.

ACTION_DISMISS

static val ACTION_DISMISS: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to dismiss a dismissable node.

ACTION_EXPAND

static val ACTION_EXPAND: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to expand an expandable node.

ACTION_FOCUS

static val ACTION_FOCUS: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that gives input focus to the node.

ACTION_HIDE_TOOLTIP

static val ACTION_HIDE_TOOLTIP: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to hide a tooltip. A node should expose this action only for views that are currently showing a tooltip.

ACTION_LONG_CLICK

static val ACTION_LONG_CLICK: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that long clicks on the node.

ACTION_NEXT_AT_MOVEMENT_GRANULARITY

static val ACTION_NEXT_AT_MOVEMENT_GRANULARITY: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that requests to go to the next entity in this node's text at a given movement granularity. For example, move to the next character, word, etc.

Arguments: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfoCompat.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN
Example: Move to the previous character and do not extend selection.

<p><code> Bundle arguments = new Bundle(); arguments.putInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_CHARACTER); arguments.putBoolean( AccessibilityNodeInfoCompat.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN, false); info.performAction( AccessibilityActionCompat.ACTION_NEXT_AT_MOVEMENT_GRANULARITY.getId(), arguments); </code></p>

ACTION_NEXT_HTML_ELEMENT

static val ACTION_NEXT_HTML_ELEMENT: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to move to the next HTML element of a given type. For example, move to the BUTTON, INPUT, TABLE, etc.

Arguments: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_HTML_ELEMENT_STRING
Example:

<p><code> Bundle arguments = new Bundle(); arguments.putString( AccessibilityNodeInfoCompat.ACTION_ARGUMENT_HTML_ELEMENT_STRING, "BUTTON"); info.performAction( AccessibilityActionCompat.ACTION_NEXT_HTML_ELEMENT.getId(), arguments); </code></p>

ACTION_PAGE_DOWN

@NonNull static val ACTION_PAGE_DOWN: AccessibilityNodeInfoCompat.AccessibilityActionCompat

Action to move to the page below.

ACTION_PAGE_LEFT

@NonNull static val ACTION_PAGE_LEFT: AccessibilityNodeInfoCompat.AccessibilityActionCompat

Action to move to the page left.

ACTION_PAGE_RIGHT

@NonNull static val ACTION_PAGE_RIGHT: AccessibilityNodeInfoCompat.AccessibilityActionCompat

Action to move to the page right.

ACTION_PAGE_UP

@NonNull static val ACTION_PAGE_UP: AccessibilityNodeInfoCompat.AccessibilityActionCompat

Action to move to the page above.

ACTION_PASTE

static val ACTION_PASTE: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to paste the current clipboard content.

ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY

static val ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that requests to go to the previous entity in this node's text at a given movement granularity. For example, move to the next character, word, etc.

Arguments: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfoCompat.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN
Example: Move to the next character and do not extend selection.

<p><code> Bundle arguments = new Bundle(); arguments.putInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_CHARACTER); arguments.putBoolean( AccessibilityNodeInfoCompat.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN, false); info.performAction( AccessibilityActionCompat.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY.getId(), arguments); </code></p>

ACTION_PREVIOUS_HTML_ELEMENT

static val ACTION_PREVIOUS_HTML_ELEMENT: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to move to the previous HTML element of a given type. For example, move to the BUTTON, INPUT, TABLE, etc.

Arguments: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_HTML_ELEMENT_STRING
Example:

<p><code> Bundle arguments = new Bundle(); arguments.putString( AccessibilityNodeInfoCompat.ACTION_ARGUMENT_HTML_ELEMENT_STRING, "BUTTON"); info.performAction( AccessibilityActionCompat.ACTION_PREVIOUS_HTML_ELEMENT.getId(), arguments); </code></p>

ACTION_SCROLL_BACKWARD

static val ACTION_SCROLL_BACKWARD: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content backward.

ACTION_SCROLL_DOWN

static val ACTION_SCROLL_DOWN: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content down.

ACTION_SCROLL_FORWARD

static val ACTION_SCROLL_FORWARD: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content forward.

ACTION_SCROLL_LEFT

static val ACTION_SCROLL_LEFT: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content left.

ACTION_SCROLL_RIGHT

static val ACTION_SCROLL_RIGHT: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content right.

ACTION_SCROLL_TO_POSITION

static val ACTION_SCROLL_TO_POSITION: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that scrolls the node to make the specified collection position visible on screen.

Arguments:

ACTION_SCROLL_UP

static val ACTION_SCROLL_UP: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to scroll the node content up.

ACTION_SELECT

static val ACTION_SELECT: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that selects the node.

ACTION_SET_PROGRESS

static val ACTION_SET_PROGRESS: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that sets progress between RangeInfo.getMin() and RangeInfo.getMax(). It should use the same value type as RangeInfo.getType()

Arguments: AccessibilityNodeInfoCompat#ACTION_ARGUMENT_PROGRESS_VALUE

See Also

ACTION_SET_SELECTION

static val ACTION_SET_SELECTION: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to set the selection. Performing this action with no arguments clears the selection.

Arguments: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SELECTION_START_INT, AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SELECTION_END_INT
Example:

<p><code> Bundle arguments = new Bundle(); arguments.putInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SELECTION_START_INT, 1); arguments.putInt(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SELECTION_END_INT, 2); info.performAction(AccessibilityActionCompat.ACTION_SET_SELECTION.getId(), arguments); </code></p>

ACTION_SET_TEXT

static val ACTION_SET_TEXT: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that sets the text of the node. Performing the action without argument, using null or empty CharSequence will clear the text. This action will also put the cursor at the end of text.

Arguments: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE
Example:

<p><code> Bundle arguments = new Bundle(); arguments.putCharSequence(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, "android"); info.performAction(AccessibilityActionCompat.ACTION_SET_TEXT.getId(), arguments); </code></p>

ACTION_SHOW_ON_SCREEN

static val ACTION_SHOW_ON_SCREEN: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action that requests the node make its bounding rectangle visible on the screen, scrolling if necessary just enough.

ACTION_SHOW_TOOLTIP

static val ACTION_SHOW_TOOLTIP: AccessibilityNodeInfoCompat.AccessibilityActionCompat!

Action to show a tooltip.