java.lang.Object | |
↳ | android.view.accessibility.AccessibilityRecord |
Known Direct Subclasses |
Represents a record in an AccessibilityEvent
and contains information
about state change of its source View
. When a view fires
an accessibility event it requests from its parent to dispatch the
constructed event. The parent may optionally append a record for itself
for providing more context to
AccessibilityService
s. Hence,
accessibility services can facilitate additional accessibility records
to enhance feedback.
Once the accessibility event containing a record is dispatched the record is made immutable and calling a state mutation method generates an error.
Note: Not all properties are applicable to all accessibility
event types. For detailed information please refer to AccessibilityEvent
.
For more information about creating and processing AccessibilityRecords, read the Accessibility developer guide.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the number of added characters.
| |||||||||||
Sets the text before a change.
| |||||||||||
Gets the class name of the source.
| |||||||||||
Gets the description of the source.
| |||||||||||
Gets the index of the source in the list of items the can be visited.
| |||||||||||
Gets the index of the first character of the changed sequence,
or the beginning of a text selection or the index of the first
visible item when scrolling.
| |||||||||||
Gets the number of items that can be visited.
| |||||||||||
Gets the max scroll offset of the source left edge in pixels.
| |||||||||||
Gets the max scroll offset of the source top edge in pixels.
| |||||||||||
Gets the
Parcelable data.
| |||||||||||
Gets the number of removed characters.
| |||||||||||
Gets the scroll offset of the source left edge in pixels.
| |||||||||||
Gets the scroll offset of the source top edge in pixels.
| |||||||||||
Gets the
AccessibilityNodeInfo of the event source.
| |||||||||||
Gets the text of the event.
| |||||||||||
Gets the index of text selection end or the index of the last
visible item when scrolling.
| |||||||||||
Gets the id of the window from which the event comes from.
| |||||||||||
Gets if the source is checked.
| |||||||||||
Gets if the source is enabled.
| |||||||||||
Gets if the source is taking the entire screen.
| |||||||||||
Gets if the source is a password field.
| |||||||||||
Gets if the source is scrollable.
| |||||||||||
Returns a cached instance if such is available or a new one is
instantiated.
| |||||||||||
Returns a cached instance if such is available or a new one is
instantiated.
| |||||||||||
Return an instance back to be reused.
| |||||||||||
Sets the number of added characters.
| |||||||||||
Sets the text before a change.
| |||||||||||
Sets if the source is checked.
| |||||||||||
Sets the class name of the source.
| |||||||||||
Sets the description of the source.
| |||||||||||
Sets the index of the source in the list of items that can be visited.
| |||||||||||
Sets if the source is enabled.
| |||||||||||
Sets the index of the first character of the changed sequence
or the beginning of a text selection or the index of the first
visible item when scrolling.
| |||||||||||
Sets if the source is taking the entire screen.
| |||||||||||
Sets the number of items that can be visited.
| |||||||||||
Sets the max scroll offset of the source left edge in pixels.
| |||||||||||
Sets the max scroll offset of the source top edge in pixels.
| |||||||||||
Sets the
Parcelable data of the event.
| |||||||||||
Sets if the source is a password field.
| |||||||||||
Sets the number of removed characters.
| |||||||||||
Sets the scroll offset of the source left edge in pixels.
| |||||||||||
Sets the scroll offset of the source top edge in pixels.
| |||||||||||
Sets if the source is scrollable.
| |||||||||||
Sets the source to be a virtual descendant of the given
root .
| |||||||||||
Sets the event source.
| |||||||||||
Sets the index of text selection end or the index of the last
visible item when scrolling.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Gets the number of added characters.
Sets the text before a change.
Gets the class name of the source.
Gets the description of the source.
Gets the index of the source in the list of items the can be visited.
Gets the index of the first character of the changed sequence, or the beginning of a text selection or the index of the first visible item when scrolling.
Gets the number of items that can be visited.
Gets the max scroll offset of the source left edge in pixels.
Gets the max scroll offset of the source top edge in pixels.
Gets the Parcelable
data.
Gets the number of removed characters.
Gets the scroll offset of the source left edge in pixels.
Gets the scroll offset of the source top edge in pixels.
Gets the AccessibilityNodeInfo
of the event source.
Note: It is a client responsibility to recycle the received info
by calling AccessibilityNodeInfo#recycle()
to avoid creating of multiple instances.
Gets the text of the event. The index in the list represents the priority of the text. Specifically, the lower the index the higher the priority.
Gets the index of text selection end or the index of the last visible item when scrolling.
Gets the id of the window from which the event comes from.
Gets if the source is checked.
Gets if the source is enabled.
Gets if the source is taking the entire screen.
Gets if the source is a password field.
Gets if the source is scrollable.
Returns a cached instance if such is available or a new one is instantiated. The instance is initialized with data from the given record.
Returns a cached instance if such is available or a new one is instantiated.
Return an instance back to be reused.
Note: You must not touch the object after calling this function.
IllegalStateException | If the record is already recycled. |
---|
Sets the number of added characters.
addedCount | The number of added characters. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the text before a change.
beforeText | The text before the change. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets if the source is checked.
isChecked | True if the view is checked, false otherwise. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the class name of the source.
className | The lass name. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the description of the source.
contentDescription | The description. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the index of the source in the list of items that can be visited.
currentItemIndex | The current item index. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets if the source is enabled.
isEnabled | True if the view is enabled, false otherwise. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the index of the first character of the changed sequence or the beginning of a text selection or the index of the first visible item when scrolling.
fromIndex | The index of the first character or selection start or the first visible item. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets if the source is taking the entire screen.
isFullScreen | True if the source is full screen, false otherwise. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the number of items that can be visited.
itemCount | The number of items. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the max scroll offset of the source left edge in pixels.
maxScrollX | The max scroll. |
---|
Sets the max scroll offset of the source top edge in pixels.
maxScrollY | The max scroll. |
---|
Sets the Parcelable
data of the event.
parcelableData | The parcelable data. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets if the source is a password field.
isPassword | True if the view is a password field, false otherwise. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the number of removed characters.
removedCount | The number of removed characters. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the scroll offset of the source left edge in pixels.
scrollX | The scroll. |
---|
Sets the scroll offset of the source top edge in pixels.
scrollY | The scroll. |
---|
Sets if the source is scrollable.
scrollable | True if the source is scrollable, false otherwise. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the source to be a virtual descendant of the given root
.
If virtualDescendantId
equals to 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 them selves as a tree of virtual views, thus conveying their logical structure.
root | The root of the virtual subtree. |
---|---|
virtualDescendantId | The id of the virtual descendant. |
Sets the event source.
source | The source. |
---|
IllegalStateException | If called from an AccessibilityService. |
---|
Sets the index of text selection end or the index of the last visible item when scrolling.
toIndex | The index of selection end or last item index. |
---|
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.