public class

AccessibilityNodeInfoCompat.AccessibilityActionCompat

extends java.lang.Object

 java.lang.Object

↳androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat

Overview

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. Each standard action is associated with a resource id, e.g. . Note that actions were formerly associated with static constants defined in this class, e.g. AccessibilityNodeInfoCompat.AccessibilityActionCompat.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 AccessibilityNodeInfoCompat.AccessibilityActionCompat.ACTION_CLICK action to indicate to the user that this action clears browsing history.

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

Summary

Fields
public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_ACCESSIBILITY_FOCUS

Action that gives accessibility focus to the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_CLEAR_ACCESSIBILITY_FOCUS

Action that clears accessibility focus of the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_CLEAR_FOCUS

Action that clears input focus of the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_CLEAR_SELECTION

Action that deselects the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_CLICK

Action that clicks on the node info.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_COLLAPSE

Action to collapse an expandable node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_CONTEXT_CLICK

Action that context clicks the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_COPY

Action to copy the current selection to the clipboard.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_CUT

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_DISMISS

Action to dismiss a dismissable node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_DRAG_CANCEL

Action to cancel a drag.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_DRAG_DROP

Action to trigger a drop of the content being dragged.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_DRAG_START

Action to start a drag.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_EXPAND

Action to expand an expandable node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_FOCUS

Action that gives input focus to the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_HIDE_TOOLTIP

Action to hide a tooltip.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_IME_ENTER

Action to send an ime actionId which is from .

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_LONG_CLICK

Action that long clicks on the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_MOVE_WINDOW

Action to move a window to a new location.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_NEXT_AT_MOVEMENT_GRANULARITY

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_NEXT_HTML_ELEMENT

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_PAGE_DOWN

Action to move to the page below.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_PAGE_LEFT

Action to move to the page left.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_PAGE_RIGHT

Action to move to the page right.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_PAGE_UP

Action to move to the page above.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_PASTE

Action to paste the current clipboard content.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_PRESS_AND_HOLD

Action that presses and holds a node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_PREVIOUS_HTML_ELEMENT

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SCROLL_BACKWARD

Action to scroll the node content backward.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SCROLL_DOWN

Action to scroll the node content down.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SCROLL_FORWARD

Action to scroll the node content forward.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SCROLL_IN_DIRECTION

Action that brings fully on screen the next node in the specified direction.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SCROLL_LEFT

Action to scroll the node content left.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SCROLL_RIGHT

Action to scroll the node content right.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SCROLL_TO_POSITION

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SCROLL_UP

Action to scroll the node content up.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SELECT

Action that selects the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SET_PROGRESS

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SET_SELECTION

Action to set the selection.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SET_TEXT

Action that sets the text of the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SHOW_ON_SCREEN

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SHOW_TEXT_SUGGESTIONS

Action to show suggestions for editable text.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompatACTION_SHOW_TOOLTIP

Action to show a tooltip.

protected final AccessibilityViewCommandmCommand

Constructors
publicAccessibilityActionCompat(int actionId, java.lang.CharSequence label)

Creates a new instance.

publicAccessibilityActionCompat(int actionId, java.lang.CharSequence label, AccessibilityViewCommand command)

Creates a new instance.

Methods
public AccessibilityNodeInfoCompat.AccessibilityActionCompatcreateReplacementAction(java.lang.CharSequence label, AccessibilityViewCommand command)

public booleanequals(java.lang.Object obj)

public intgetId()

Gets the id for this action.

public java.lang.CharSequencegetLabel()

Gets the label for this action.

public inthashCode()

public booleanperform(View view, Bundle arguments)

Performs the action.

public java.lang.StringtoString()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait

Fields

Action that gives input focus to the node.

The focus request sends an event of if successful. In the View system, this is handled by View.

The node that is focused should return true for AccessibilityNodeInfoCompat.isFocused().

See also: for the difference between system focus and accessibility focus.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_CLEAR_FOCUS

Action that clears input focus of the node.

The node that is cleared should return false for AccessibilityNodeInfoCompat.isFocused().

Action that selects the node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_CLEAR_SELECTION

Action that deselects the node.

Action that clicks on the node info.

The UI element that implements this should send a event. In the View system, the default handling of this action when performed by a service is to call View, and setting a View automatically adds this action.

AccessibilityNodeInfoCompat.isClickable() should return true if this action is available.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_LONG_CLICK

Action that long clicks on the node.

The UI element that implements this should send a event. In the View system, the default handling of this action when performed by a service is to call View, and setting a View automatically adds this action.

AccessibilityNodeInfoCompat.isLongClickable() should return true if this action is available.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_ACCESSIBILITY_FOCUS

Action that gives accessibility focus to the node.

The UI element that implements this should send a event if successful. The node that is focused should return true for AccessibilityNodeInfoCompat.isAccessibilityFocused().

This is intended to be used by screen readers to assist with user navigation. Apps changing focus can confuse screen readers, so the resulting behavior can vary by device and screen reader version.

This is distinct from AccessibilityNodeInfoCompat.AccessibilityActionCompat.ACTION_FOCUS, which refers to system focus. System focus is typically used to convey targets for keyboard navigation.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_CLEAR_ACCESSIBILITY_FOCUS

Action that clears accessibility focus of the node.

The UI element that implements this should send a event if successful. The node that is cleared should return false for AccessibilityNodeInfoCompat.isAccessibilityFocused().

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_NEXT_AT_MOVEMENT_GRANULARITY

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.

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);

See also: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfoCompat.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN, AccessibilityNodeInfoCompat.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN, AccessibilityNodeInfoCompat.getMovementGranularities(), AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_CHARACTER, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_WORD, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_LINE, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_PARAGRAPH, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_PAGE

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY

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.

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);

See also: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfoCompat.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN, AccessibilityNodeInfoCompat.setMovementGranularities(int), AccessibilityNodeInfoCompat.getMovementGranularities(), AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_CHARACTER, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_WORD, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_LINE, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_PARAGRAPH, AccessibilityNodeInfoCompat.MOVEMENT_GRANULARITY_PAGE

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_NEXT_HTML_ELEMENT

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:

Bundle arguments = new Bundle(); arguments.putString( AccessibilityNodeInfoCompat.ACTION_ARGUMENT_HTML_ELEMENT_STRING, "BUTTON"); info.performAction( AccessibilityActionCompat.ACTION_NEXT_HTML_ELEMENT.getId(), arguments);

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_PREVIOUS_HTML_ELEMENT

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:

Bundle arguments = new Bundle(); arguments.putString( AccessibilityNodeInfoCompat.ACTION_ARGUMENT_HTML_ELEMENT_STRING, "BUTTON"); info.performAction( AccessibilityActionCompat.ACTION_PREVIOUS_HTML_ELEMENT.getId(), arguments);

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_SCROLL_FORWARD

Action to scroll the node content forward.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_SCROLL_BACKWARD

Action to scroll the node content backward.

Action to copy the current selection to the clipboard.

Action to paste the current clipboard content.

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

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_SET_SELECTION

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:

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);

If this is a text selection, the UI element that implements this should send a event if its selection is updated. This element should also return true for AccessibilityNodeInfoCompat.isTextSelectable().

See also: AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SELECTION_START_INT, AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SELECTION_END_INT

Action to expand an expandable node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_COLLAPSE

Action to collapse an expandable node.

Action to dismiss a dismissable node.

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_SET_TEXT

Action that sets the text of the node. Performing the action without argument, using null or empty java.lang.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:

Bundle arguments = new Bundle(); arguments.putCharSequence(AccessibilityNodeInfoCompat.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, "android"); info.performAction(AccessibilityActionCompat.ACTION_SET_TEXT.getId(), arguments);

The UI element that implements this should send a event if its text is updated. This element should also return true for AccessibilityNodeInfoCompat.isEditable().

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_SHOW_ON_SCREEN

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

See also: View

public static final AccessibilityNodeInfoCompat.AccessibilityActionCompat ACTION_SCROLL_TO_POSITION

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

Arguments: