android.support.v4.view.accessibility
Class AccessibilityNodeInfoCompat

java.lang.Object
  extended by android.support.v4.view.accessibility.AccessibilityNodeInfoCompat

public class AccessibilityNodeInfoCompat
extends Object

Helper for accessing AccessibilityNodeInfo introduced after API level 4 in a backwards compatible fashion.


Field Summary
static int ACTION_ACCESSIBILITY_FOCUS
          Action that gives accessibility focus to the node.
static String ACTION_ARGUMENT_HTML_ELEMENT_STRING
          Argument for which HTML element to get moving to the next/previous HTML element.
static String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
          Argument for which movement granularity to be used when traversing the node text.
static int ACTION_CLEAR_ACCESSIBILITY_FOCUS
          Action that clears accessibility focus of the node.
static int ACTION_CLEAR_FOCUS
          Action that unfocuses the node.
static int ACTION_CLEAR_SELECTION
          Action that unselects the node.
static int ACTION_CLICK
          Action that clicks on the node info.
static int ACTION_FOCUS
          Action that focuses the node.
static int ACTION_LONG_CLICK
          Action that long clicks on the node.
static int ACTION_NEXT_AT_MOVEMENT_GRANULARITY
          Action that requests to go to the next entity in this node's text at a given movement granularity.
static int ACTION_NEXT_HTML_ELEMENT
          Action to move to the next HTML element of a given type.
static int ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY
          Action that requests to go to the previous entity in this node's text at a given movement granularity.
static int ACTION_PREVIOUS_HTML_ELEMENT
          Action to move to the previous HTML element of a given type.
static int ACTION_SCROLL_BACKWARD
          Action to scroll the node content backward.
static int ACTION_SCROLL_FORWARD
          Action to scroll the node content forward.
static int ACTION_SELECT
          Action that selects the node.
static int FOCUS_ACCESSIBILITY
          The accessibility focus.
static int FOCUS_INPUT
          The input focus.
static int MOVEMENT_GRANULARITY_CHARACTER
          Movement granularity bit for traversing the text of a node by character.
static int MOVEMENT_GRANULARITY_LINE
          Movement granularity bit for traversing the text of a node by line.
static int MOVEMENT_GRANULARITY_PAGE
          Movement granularity bit for traversing the text of a node by page.
static int MOVEMENT_GRANULARITY_PARAGRAPH
          Movement granularity bit for traversing the text of a node by paragraph.
static int MOVEMENT_GRANULARITY_WORD
          Movement granularity bit for traversing the text of a node by word.
 
Constructor Summary
AccessibilityNodeInfoCompat(Object info)
          Creates a new instance wrapping an AccessibilityNodeInfo.
 
Method Summary
 void addAction(int action)
          Adds an action that can be performed on the node.
 void addChild(android.view.View child)
          Adds a child.
 void addChild(android.view.View root, int virtualDescendantId)
          Adds a virtual child which is a descendant of the given root.
 boolean equals(Object obj)
           
 List<AccessibilityNodeInfoCompat> findAccessibilityNodeInfosByText(String text)
          Finds AccessibilityNodeInfos by text.
 AccessibilityNodeInfoCompat findFocus(int focus)
          Find the view that has the specified focus type.
 AccessibilityNodeInfoCompat focusSearch(int direction)
          Searches for the nearest view in the specified direction that can take input focus.
 int getActions()
          Gets the actions that can be performed on the node.
 void getBoundsInParent(android.graphics.Rect outBounds)
          Gets the node bounds in parent coordinates.
 void getBoundsInScreen(android.graphics.Rect outBounds)
          Gets the node bounds in screen coordinates.
 AccessibilityNodeInfoCompat getChild(int index)
          Get the child at given index.
 int getChildCount()
          Gets the number of children.
 CharSequence getClassName()
          Gets the class this node comes from.
 CharSequence getContentDescription()
          Gets the content description of this node.
 Object getInfo()
           
 int getMovementGranularities()
          Gets the movement granularities for traversing the text of this node.
 CharSequence getPackageName()
          Gets the package this node comes from.
 AccessibilityNodeInfoCompat getParent()
          Gets the parent.
 CharSequence getText()
          Gets the text of this node.
 int getWindowId()
          Gets the id of the window from which the info comes from.
 int hashCode()
           
 boolean isAccessibilityFocused()
          Gets whether this node is accessibility focused.
 boolean isCheckable()
          Gets whether this node is checkable.
 boolean isChecked()
          Gets whether this node is checked.
 boolean isClickable()
          Gets whether this node is clickable.
 boolean isEnabled()
          Gets whether this node is enabled.
 boolean isFocusable()
          Gets whether this node is focusable.
 boolean isFocused()
          Gets whether this node is focused.
 boolean isLongClickable()
          Gets whether this node is long clickable.
 boolean isPassword()
          Gets whether this node is a password.
 boolean isScrollable()
          Gets if the node is scrollable.
 boolean isSelected()
          Gets whether this node is selected.
 boolean isVisibleToUser()
          Sets whether this node is visible to the user.
static AccessibilityNodeInfoCompat obtain()
          Returns a cached instance if such is available otherwise a new one.
static AccessibilityNodeInfoCompat obtain(AccessibilityNodeInfoCompat info)
          Returns a cached instance if such is available or a new one is create.
static AccessibilityNodeInfoCompat obtain(android.view.View source)
          Returns a cached instance if such is available otherwise a new one and sets the source.
static AccessibilityNodeInfoCompat obtain(android.view.View root, int virtualDescendantId)
          Returns a cached instance if such is available otherwise a new one and sets the source.
 boolean performAction(int action)
          Performs an action on the node.
 boolean performAction(int action, android.os.Bundle arguments)
          Performs an action on the node.
 void recycle()
          Return an instance back to be reused.
 void setAccessibilityFocused(boolean focused)
          Sets whether this node is accessibility focused.
 void setBoundsInParent(android.graphics.Rect bounds)
          Sets the node bounds in parent coordinates.
 void setBoundsInScreen(android.graphics.Rect bounds)
          Sets the node bounds in screen coordinates.
 void setCheckable(boolean checkable)
          Sets whether this node is checkable.
 void setChecked(boolean checked)
          Sets whether this node is checked.
 void setClassName(CharSequence className)
          Sets the class this node comes from.
 void setClickable(boolean clickable)
          Sets whether this node is clickable.
 void setContentDescription(CharSequence contentDescription)
          Sets the content description of this node.
 void setEnabled(boolean enabled)
          Sets whether this node is enabled.
 void setFocusable(boolean focusable)
          Sets whether this node is focusable.
 void setFocused(boolean focused)
          Sets whether this node is focused.
 void setLongClickable(boolean longClickable)
          Sets whether this node is long clickable.
 void setMovementGranularities(int granularities)
          Sets the movement granularities for traversing the text of this node.
 void setPackageName(CharSequence packageName)
          Sets the package this node comes from.
 void setParent(android.view.View parent)
          Sets the parent.
 void setParent(android.view.View root, int virtualDescendantId)
          Sets the parent to be a virtual descendant of the given root.
 void setPassword(boolean password)
          Sets whether this node is a password.
 void setScrollable(boolean scrollable)
          Sets if the node is scrollable.
 void setSelected(boolean selected)
          Sets whether this node is selected.
 void setSource(android.view.View source)
          Sets the source.
 void setSource(android.view.View root, int virtualDescendantId)
          Sets the source to be a virtual descendant of the given root.
 void setText(CharSequence text)
          Sets the text of this node.
 void setVisibleToUser(boolean visibleToUser)
          Sets whether this node is visible to the user.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_FOCUS

public static final int ACTION_FOCUS
Action that focuses the node.

See Also:
Constant Field Values

ACTION_CLEAR_FOCUS

public static final int ACTION_CLEAR_FOCUS
Action that unfocuses the node.

See Also:
Constant Field Values

ACTION_SELECT

public static final int ACTION_SELECT
Action that selects the node.

See Also:
Constant Field Values

ACTION_CLEAR_SELECTION

public static final int ACTION_CLEAR_SELECTION
Action that unselects the node.

See Also:
Constant Field Values

ACTION_CLICK

public static final int ACTION_CLICK
Action that clicks on the node info.

See Also:
Constant Field Values

ACTION_LONG_CLICK

public static final int ACTION_LONG_CLICK
Action that long clicks on the node.

See Also:
Constant Field Values

ACTION_ACCESSIBILITY_FOCUS

public static final int ACTION_ACCESSIBILITY_FOCUS
Action that gives accessibility focus to the node.

See Also:
Constant Field Values

ACTION_CLEAR_ACCESSIBILITY_FOCUS

public static final int ACTION_CLEAR_ACCESSIBILITY_FOCUS
Action that clears accessibility focus of the node.

See Also:
Constant Field Values

ACTION_NEXT_AT_MOVEMENT_GRANULARITY

public static final int 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: ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
Example:

Bundle arguments = new Bundle(); arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER); info.performAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments);

See Also:
setMovementGranularities(int), getMovementGranularities(), MOVEMENT_GRANULARITY_CHARACTER, MOVEMENT_GRANULARITY_WORD, MOVEMENT_GRANULARITY_LINE, MOVEMENT_GRANULARITY_PARAGRAPH, MOVEMENT_GRANULARITY_PAGE, Constant Field Values

ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY

public static final int 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: ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
Example:

Bundle arguments = new Bundle(); arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT, AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER); info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY, arguments);

See Also:
setMovementGranularities(int), getMovementGranularities(), MOVEMENT_GRANULARITY_CHARACTER, MOVEMENT_GRANULARITY_WORD, MOVEMENT_GRANULARITY_LINE, MOVEMENT_GRANULARITY_PARAGRAPH, MOVEMENT_GRANULARITY_PAGE, Constant Field Values

ACTION_NEXT_HTML_ELEMENT

public static final int 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: ACTION_ARGUMENT_HTML_ELEMENT_STRING
Example:

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

See Also:
Constant Field Values

ACTION_PREVIOUS_HTML_ELEMENT

public static final int 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: ACTION_ARGUMENT_HTML_ELEMENT_STRING
Example:

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

See Also:
Constant Field Values

ACTION_SCROLL_FORWARD

public static final int ACTION_SCROLL_FORWARD
Action to scroll the node content forward.

See Also:
Constant Field Values

ACTION_SCROLL_BACKWARD

public static final int ACTION_SCROLL_BACKWARD
Action to scroll the node content backward.

See Also:
Constant Field Values

ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT

public static final String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
Argument for which movement granularity to be used when traversing the node text.

Type: int
Actions: ACTION_NEXT_AT_MOVEMENT_GRANULARITY, ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY

See Also:
Constant Field Values

ACTION_ARGUMENT_HTML_ELEMENT_STRING

public static final String ACTION_ARGUMENT_HTML_ELEMENT_STRING
Argument for which HTML element to get moving to the next/previous HTML element.

Type: String
Actions: ACTION_NEXT_HTML_ELEMENT, ACTION_PREVIOUS_HTML_ELEMENT

See Also:
Constant Field Values

FOCUS_INPUT

public static final int FOCUS_INPUT
The input focus.

See Also:
Constant Field Values

FOCUS_ACCESSIBILITY

public static final int FOCUS_ACCESSIBILITY
The accessibility focus.

See Also:
Constant Field Values

MOVEMENT_GRANULARITY_CHARACTER

public static final int MOVEMENT_GRANULARITY_CHARACTER
Movement granularity bit for traversing the text of a node by character.

See Also:
Constant Field Values

MOVEMENT_GRANULARITY_WORD

public static final int MOVEMENT_GRANULARITY_WORD
Movement granularity bit for traversing the text of a node by word.

See Also:
Constant Field Values

MOVEMENT_GRANULARITY_LINE

public static final int MOVEMENT_GRANULARITY_LINE
Movement granularity bit for traversing the text of a node by line.

See Also:
Constant Field Values

MOVEMENT_GRANULARITY_PARAGRAPH

public static final int MOVEMENT_GRANULARITY_PARAGRAPH
Movement granularity bit for traversing the text of a node by paragraph.

See Also:
Constant Field Values

MOVEMENT_GRANULARITY_PAGE

public static final int MOVEMENT_GRANULARITY_PAGE
Movement granularity bit for traversing the text of a node by page.

See Also:
Constant Field Values
Constructor Detail

AccessibilityNodeInfoCompat

public AccessibilityNodeInfoCompat(Object info)
Creates a new instance wrapping an AccessibilityNodeInfo.

Parameters:
info - The info.
Method Detail

getInfo

public Object getInfo()
Returns:
The wrapped AccessibilityNodeInfo.

obtain

public static AccessibilityNodeInfoCompat obtain(android.view.View source)
Returns a cached instance if such is available otherwise a new one and sets the source.

Returns:
An instance.
See Also:
setSource(View)

obtain

public static AccessibilityNodeInfoCompat obtain(android.view.View root,
                                                 int virtualDescendantId)
Returns a cached instance if such is available otherwise a new one and sets the source.

Parameters:
root - The root of the virtual subtree.
virtualDescendantId - The id of the virtual descendant.
Returns:
An instance.
See Also:
setSource(View, int)

obtain

public static AccessibilityNodeInfoCompat obtain()
Returns a cached instance if such is available otherwise a new one.

Returns:
An instance.

obtain

public static AccessibilityNodeInfoCompat obtain(AccessibilityNodeInfoCompat info)
Returns a cached instance if such is available or a new one is create. The returned instance is initialized from the given info.

Parameters:
info - The other info.
Returns:
An instance.

setSource

public void setSource(android.view.View source)
Sets the source.

Parameters:
source - The info source.

setSource

public void setSource(android.view.View root,
                      int virtualDescendantId)
Sets the source to be a virtual descendant of the given root. If virtualDescendantId is View.NO_ID the root is set as the source.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report themselves as a tree of virtual views, thus conveying their logical structure.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
root - The root of the virtual subtree.
virtualDescendantId - The id of the virtual descendant.

findFocus

public AccessibilityNodeInfoCompat findFocus(int focus)
Find the view that has the specified focus type. The search starts from the view represented by this node info.

Parameters:
focus - The focus to find. One of FOCUS_INPUT or FOCUS_ACCESSIBILITY.
Returns:
The node info of the focused view or null.
See Also:
FOCUS_INPUT, FOCUS_ACCESSIBILITY

focusSearch

public AccessibilityNodeInfoCompat focusSearch(int direction)
Searches for the nearest view in the specified direction that can take input focus.

Parameters:
direction - The direction. Can be one of: View.FOCUS_DOWN, View.FOCUS_UP, View.FOCUS_LEFT, View.FOCUS_RIGHT, View.FOCUS_FORWARD, View.FOCUS_BACKWARD.
Returns:
The node info for the view that can take accessibility focus.

getWindowId

public int getWindowId()
Gets the id of the window from which the info comes from.

Returns:
The window id.

getChildCount

public int getChildCount()
Gets the number of children.

Returns:
The child count.

getChild

public AccessibilityNodeInfoCompat getChild(int index)
Get the child at given index.

Note: It is a client responsibility to recycle the received info by calling recycle() to avoid creating of multiple instances.

Parameters:
index - The child index.
Returns:
The child node.
Throws:
IllegalStateException - If called outside of an AccessibilityService.

addChild

public void addChild(android.view.View child)
Adds a child.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
child - The child.
Throws:
IllegalStateException - If called from an AccessibilityService.

addChild

public void addChild(android.view.View root,
                     int virtualDescendantId)
Adds a virtual child which is a descendant of the given root. If virtualDescendantId is View.NO_ID the root is added as a child.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

Parameters:
root - The root of the virtual subtree.
virtualDescendantId - The id of the virtual child.

getActions

public int getActions()
Gets the actions that can be performed on the node.

Returns:
The bit mask of with actions.
See Also:
AccessibilityNodeInfo.ACTION_FOCUS, AccessibilityNodeInfo.ACTION_CLEAR_FOCUS, AccessibilityNodeInfo.ACTION_SELECT, AccessibilityNodeInfo.ACTION_CLEAR_SELECTION

addAction

public void addAction(int action)
Adds an action that can be performed on the node.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
action - The action.
Throws:
IllegalStateException - If called from an AccessibilityService.

performAction

public boolean performAction(int action)
Performs an action on the node.

Note: An action can be performed only if the request is made from an AccessibilityService.

Parameters:
action - The action to perform.
Returns:
True if the action was performed.
Throws:
IllegalStateException - If called outside of an AccessibilityService.

performAction

public boolean performAction(int action,
                             android.os.Bundle arguments)
Performs an action on the node.

Note: An action can be performed only if the request is made from an AccessibilityService.

Parameters:
action - The action to perform.
arguments - A bundle with additional arguments.
Returns:
True if the action was performed.
Throws:
IllegalStateException - If called outside of an AccessibilityService.

setMovementGranularities

public void setMovementGranularities(int granularities)
Sets the movement granularities for traversing the text of this node.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
granularities - The bit mask with granularities.
Throws:
IllegalStateException - If called from an AccessibilityService.

getMovementGranularities

public int getMovementGranularities()
Gets the movement granularities for traversing the text of this node.

Returns:
The bit mask with granularities.

findAccessibilityNodeInfosByText

public List<AccessibilityNodeInfoCompat> findAccessibilityNodeInfosByText(String text)
Finds AccessibilityNodeInfos by text. The match is case insensitive containment. The search is relative to this info i.e. this info is the root of the traversed tree.

Note: It is a client responsibility to recycle the received info by calling AccessibilityNodeInfo.recycle() to avoid creating of multiple instances.

Parameters:
text - The searched text.
Returns:
A list of node info.

getParent

public AccessibilityNodeInfoCompat getParent()
Gets the parent.

Note: It is a client responsibility to recycle the received info by calling AccessibilityNodeInfo.recycle() to avoid creating of multiple instances.

Returns:
The parent.

setParent

public void setParent(android.view.View parent)
Sets the parent.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
parent - The parent.
Throws:
IllegalStateException - If called from an AccessibilityService.

setParent

public void setParent(android.view.View root,
                      int virtualDescendantId)
Sets the parent to be a virtual descendant of the given root. If virtualDescendantId equals to View.NO_ID the root is set as the parent.

A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
root - The root of the virtual subtree.
virtualDescendantId - The id of the virtual descendant.

getBoundsInParent

public void getBoundsInParent(android.graphics.Rect outBounds)
Gets the node bounds in parent coordinates.

Parameters:
outBounds - The output node bounds.

setBoundsInParent

public void setBoundsInParent(android.graphics.Rect bounds)
Sets the node bounds in parent coordinates.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
bounds - The node bounds.
Throws:
IllegalStateException - If called from an AccessibilityService.

getBoundsInScreen

public void getBoundsInScreen(android.graphics.Rect outBounds)
Gets the node bounds in screen coordinates.

Parameters:
outBounds - The output node bounds.

setBoundsInScreen

public void setBoundsInScreen(android.graphics.Rect bounds)
Sets the node bounds in screen coordinates.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
bounds - The node bounds.
Throws:
IllegalStateException - If called from an AccessibilityService.

isCheckable

public boolean isCheckable()
Gets whether this node is checkable.

Returns:
True if the node is checkable.

setCheckable

public void setCheckable(boolean checkable)
Sets whether this node is checkable.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
checkable - True if the node is checkable.
Throws:
IllegalStateException - If called from an AccessibilityService.

isChecked

public boolean isChecked()
Gets whether this node is checked.

Returns:
True if the node is checked.

setChecked

public void setChecked(boolean checked)
Sets whether this node is checked.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
checked - True if the node is checked.
Throws:
IllegalStateException - If called from an AccessibilityService.

isFocusable

public boolean isFocusable()
Gets whether this node is focusable.

Returns:
True if the node is focusable.

setFocusable

public void setFocusable(boolean focusable)
Sets whether this node is focusable.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
focusable - True if the node is focusable.
Throws:
IllegalStateException - If called from an AccessibilityService.

isFocused

public boolean isFocused()
Gets whether this node is focused.

Returns:
True if the node is focused.

setFocused

public void setFocused(boolean focused)
Sets whether this node is focused.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
focused - True if the node is focused.
Throws:
IllegalStateException - If called from an AccessibilityService.

isVisibleToUser

public boolean isVisibleToUser()
Sets whether this node is visible to the user.

Returns:
Whether the node is visible to the user.

setVisibleToUser

public void setVisibleToUser(boolean visibleToUser)
Sets whether this node is visible to the user.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
visibleToUser - Whether the node is visible to the user.
Throws:
IllegalStateException - If called from an AccessibilityService.

isAccessibilityFocused

public boolean isAccessibilityFocused()
Gets whether this node is accessibility focused.

Returns:
True if the node is accessibility focused.

setAccessibilityFocused

public void setAccessibilityFocused(boolean focused)
Sets whether this node is accessibility focused.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
focused - True if the node is accessibility focused.
Throws:
IllegalStateException - If called from an AccessibilityService.

isSelected

public boolean isSelected()
Gets whether this node is selected.

Returns:
True if the node is selected.

setSelected

public void setSelected(boolean selected)
Sets whether this node is selected.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
selected - True if the node is selected.
Throws:
IllegalStateException - If called from an AccessibilityService.

isClickable

public boolean isClickable()
Gets whether this node is clickable.

Returns:
True if the node is clickable.

setClickable

public void setClickable(boolean clickable)
Sets whether this node is clickable.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
clickable - True if the node is clickable.
Throws:
IllegalStateException - If called from an AccessibilityService.

isLongClickable

public boolean isLongClickable()
Gets whether this node is long clickable.

Returns:
True if the node is long clickable.

setLongClickable

public void setLongClickable(boolean longClickable)
Sets whether this node is long clickable.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
longClickable - True if the node is long clickable.
Throws:
IllegalStateException - If called from an AccessibilityService.

isEnabled

public boolean isEnabled()
Gets whether this node is enabled.

Returns:
True if the node is enabled.

setEnabled

public void setEnabled(boolean enabled)
Sets whether this node is enabled.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
enabled - True if the node is enabled.
Throws:
IllegalStateException - If called from an AccessibilityService.

isPassword

public boolean isPassword()
Gets whether this node is a password.

Returns:
True if the node is a password.

setPassword

public void setPassword(boolean password)
Sets whether this node is a password.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
password - True if the node is a password.
Throws:
IllegalStateException - If called from an AccessibilityService.

isScrollable

public boolean isScrollable()
Gets if the node is scrollable.

Returns:
True if the node is scrollable, false otherwise.

setScrollable

public void setScrollable(boolean scrollable)
Sets if the node is scrollable.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
scrollable - True if the node is scrollable, false otherwise.
Throws:
IllegalStateException - If called from an AccessibilityService.

getPackageName

public CharSequence getPackageName()
Gets the package this node comes from.

Returns:
The package name.

setPackageName

public void setPackageName(CharSequence packageName)
Sets the package this node comes from.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
packageName - The package name.
Throws:
IllegalStateException - If called from an AccessibilityService.

getClassName

public CharSequence getClassName()
Gets the class this node comes from.

Returns:
The class name.

setClassName

public void setClassName(CharSequence className)
Sets the class this node comes from.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
className - The class name.
Throws:
IllegalStateException - If called from an AccessibilityService.

getText

public CharSequence getText()
Gets the text of this node.

Returns:
The text.

setText

public void setText(CharSequence text)
Sets the text of this node.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
text - The text.
Throws:
IllegalStateException - If called from an AccessibilityService.

getContentDescription

public CharSequence getContentDescription()
Gets the content description of this node.

Returns:
The content description.

setContentDescription

public void setContentDescription(CharSequence contentDescription)
Sets the content description of this node.

Note: Cannot be called from an AccessibilityService. This class is made immutable before being delivered to an AccessibilityService.

Parameters:
contentDescription - The content description.
Throws:
IllegalStateException - If called from an AccessibilityService.

recycle

public void recycle()
Return an instance back to be reused.

Note: You must not touch the object after calling this function.

Throws:
IllegalStateException - If the info is already recycled.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013 Marek Kedzierski. All Rights Reserved.