java.lang.Object | |
↳ | android.view.accessibility.AccessibilityNodeInfo |
This class represents a node of the window content as well as actions that
can be requested from its source. From the point of view of an
AccessibilityService
a window content is
presented as tree of accessibility node info which may or may not map one-to-one
to the view hierarchy. In other words, a custom view is free to report itself as
a tree of accessibility node info.
Once an accessibility node info is delivered to an accessibility service it is made immutable and calling a state mutation method generates an error.
Please refer to AccessibilityService
for
details about how to obtain a handle to window content as a tree of accessibility
node info as well as familiarizing with the security model.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ACTION_CLEAR_FOCUS | Action that unfocuses the node. | |||||||||
int | ACTION_CLEAR_SELECTION | Action that unselects the node. | |||||||||
int | ACTION_FOCUS | Action that focuses the node. | |||||||||
int | ACTION_SELECT | Action that selects the node. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds an action that can be performed on the node.
| |||||||||||
Adds a child.
| |||||||||||
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
Compares this instance with the specified object and indicates if they
are equal.
| |||||||||||
Finds
AccessibilityNodeInfo s by text. | |||||||||||
Gets the actions that can be performed on the node.
| |||||||||||
Gets the node bounds in parent coordinates.
| |||||||||||
Gets the node bounds in screen coordinates.
| |||||||||||
Get the child at given index.
| |||||||||||
Gets the number of children.
| |||||||||||
Gets the class this node comes from.
| |||||||||||
Gets the content description of this node.
| |||||||||||
Gets the package this node comes from.
| |||||||||||
Gets the parent.
| |||||||||||
Gets the text of this node.
| |||||||||||
Gets the id of the window from which the info comes from.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
Gets whether this node is checkable.
| |||||||||||
Gets whether this node is checked.
| |||||||||||
Gets whether this node is clickable.
| |||||||||||
Gets whether this node is enabled.
| |||||||||||
Gets whether this node is focusable.
| |||||||||||
Gets whether this node is focused.
| |||||||||||
Gets whether this node is long clickable.
| |||||||||||
Gets whether this node is a password.
| |||||||||||
Gets if the node is scrollable.
| |||||||||||
Gets whether this node is selected.
| |||||||||||
Returns a cached instance if such is available or a new one is
create.
| |||||||||||
Returns a cached instance if such is available otherwise a new one.
| |||||||||||
Returns a cached instance if such is available otherwise a new one
and sets the source.
| |||||||||||
Performs an action on the node.
| |||||||||||
Return an instance back to be reused.
| |||||||||||
Sets the node bounds in parent coordinates.
| |||||||||||
Sets the node bounds in screen coordinates.
| |||||||||||
Sets whether this node is checkable.
| |||||||||||
Sets whether this node is checked.
| |||||||||||
Sets the class this node comes from.
| |||||||||||
Sets whether this node is clickable.
| |||||||||||
Sets the content description of this node.
| |||||||||||
Sets whether this node is enabled.
| |||||||||||
Sets whether this node is focusable.
| |||||||||||
Sets whether this node is focused.
| |||||||||||
Sets whether this node is long clickable.
| |||||||||||
Sets the package this node comes from.
| |||||||||||
Sets the parent.
| |||||||||||
Sets whether this node is a password.
| |||||||||||
Sets if the node is scrollable.
| |||||||||||
Sets whether this node is selected.
| |||||||||||
Sets the source.
| |||||||||||
Sets the text of this node.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Flatten this object in to a Parcel.
Note: After the instance is written to a parcel it is recycled. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Action that unfocuses the node.
Action that unselects the node.
Action that focuses the node.
Action that selects the node.
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.
action | The action. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Adds a child.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
child | The child. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Compares this instance with the specified object and indicates if they
are equal. In order to be equal, o
must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true
only if this ==
o
. See Writing a correct
equals
method
if you intend implementing your own equals
method.
The general contract for the equals
and hashCode()
methods is that if equals
returns true
for
any two objects, then hashCode()
must return the same value for
these objects. This means that subclasses of Object
usually
override either both methods or neither of them.
object | the object to compare this instance with. |
---|
true
if the specified object is equal to this Object
; false
otherwise.Finds AccessibilityNodeInfo
s 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 recycle()
to avoid creating of multiple instances.
text | The searched text. |
---|
Gets the actions that can be performed on the node.
Gets the node bounds in parent coordinates.
outBounds | The output node bounds. |
---|
Gets the node bounds in screen coordinates.
outBounds | The output node bounds. |
---|
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.
index | The child index. |
---|
IllegalStateException | If called outside of an AccessibilityService. |
---|
Gets the number of children.
Gets the class this node comes from.
Gets the content description of this node.
Gets the package this node comes from.
Gets the parent.
Note: It is a client responsibility to recycle the
received info by calling recycle()
to avoid creating of multiple instances.
Gets the id of the window from which the info comes from.
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode
method
if you intend implementing your own hashCode
method.
Gets whether this node is checkable.
Gets whether this node is checked.
Gets whether this node is clickable.
Gets whether this node is enabled.
Gets whether this node is focusable.
Gets whether this node is focused.
Gets whether this node is long clickable.
Gets whether this node is a password.
Gets if the node is scrollable.
Gets whether this node is selected.
Returns a cached instance if such is available or a new one is
create. The returned instance is initialized from the given
info
.
info | The other info. |
---|
Returns a cached instance if such is available otherwise a new one.
Returns a cached instance if such is available otherwise a new one and sets the source.
Performs an action on the node.
Note: An action can be performed only if the request is made
from an AccessibilityService
.
action | The action to perform. |
---|
IllegalStateException | If called outside of an AccessibilityService. |
---|
Return an instance back to be reused.
Note: You must not touch the object after calling this function.
IllegalStateException | If the info is already recycled. |
---|
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.
bounds | The node bounds. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
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.
bounds | The node bounds. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets whether this node is checkable.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
checkable | True if the node is checkable. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets whether this node is checked.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
checked | True if the node is checked. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
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.
className | The class name. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets whether this node is clickable.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
clickable | True if the node is clickable. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
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.
contentDescription | The content description. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets whether this node is enabled.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
enabled | True if the node is enabled. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets whether this node is focusable.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
focusable | True if the node is focusable. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets whether this node is focused.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
focused | True if the node is focused. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
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.
longClickable | True if the node is long clickable. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
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.
packageName | The package name. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the parent.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
parent | The parent. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
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.
password | True if the node is a password. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets if the node is scrollable.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
scrollable | True if the node is scrollable, false otherwise. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets whether this node is selected.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
selected | True if the node is selected. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the source.
source | The info source. |
---|
Sets the text of this node.
Note: Cannot be called from an
AccessibilityService
.
This class is made immutable before being delivered to an AccessibilityService.
text | The text. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
Flatten this object in to a Parcel.
Note: After the instance is written to a parcel it is recycled. You must not touch the object after calling this function.
parcel | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|