AccessibilityEventCompat
class AccessibilityEventCompat
kotlin.Any | |
↳ | androidx.core.view.accessibility.AccessibilityEventCompat |
Helper for accessing features in AccessibilityEvent
.
Summary
Constants |
|
---|---|
static Int |
Change type for |
static Int |
Change type for |
static Int |
Change type for |
static Int |
Change type for |
static Int |
Change type for |
static Int |
Change type for |
static Int |
Change type for |
static Int |
Mask for |
static Int |
Represents the event of an application making an announcement. |
static Int |
Represents the event of the assistant currently reading the users screen context. |
static Int |
Represents the event of ending gesture detection. |
static Int |
Represents the event of beginning gesture detection. |
static Int |
Represents the event of ending a touch exploration gesture. |
static Int |
Represents the event of starting a touch exploration gesture. |
static Int |
Represents the event of the user ending to touch the screen. |
static Int |
Represents the event of the user starting to touch the screen. |
static Int |
Represents the event of gaining accessibility focus. |
static Int |
Represents the event of clearing accessibility focus. |
static Int |
Represents the event of a context click on a |
static Int |
Represents the event of a hover enter over a |
static Int |
Represents the event of a hover exit over a |
static Int |
Represents the event of scrolling a view. |
static Int |
Represents the event of changing the selection in an |
static Int |
Represents the event of traversing the text of a view at a given movement granularity. |
static Int |
Represents the event change in the windows shown on the screen. |
static Int |
Represents the event of changing the content of a window. |
Public methods |
|
---|---|
static Unit |
appendRecord(event: AccessibilityEvent!, record: AccessibilityRecordCompat!) Appends an |
static AccessibilityRecordCompat! |
asRecord(event: AccessibilityEvent!) Creates an |
static Int |
getAction(event: AccessibilityEvent!) Gets the performed action that triggered this event. |
static Int |
getContentChangeTypes(event: AccessibilityEvent!) Gets the bit mask of change types signaled by an |
static Int |
getMovementGranularity(event: AccessibilityEvent!) Gets the movement granularity that was traversed. |
static AccessibilityRecordCompat! |
getRecord(event: AccessibilityEvent!, index: Int) Gets the record at a given index. |
static Int |
getRecordCount(event: AccessibilityEvent!) Gets the number of records contained in the event. |
static Unit |
setAction(event: AccessibilityEvent!, action: Int) Sets the performed action that triggered this event. |
static Unit |
setContentChangeTypes(event: AccessibilityEvent!, changeTypes: Int) Sets the bit mask of node tree changes signaled by an |
static Unit |
setMovementGranularity(event: AccessibilityEvent!, granularity: Int) Sets the movement granularity that was traversed. |
Constants
CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION
static val CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION: Int
Change type for TYPE_WINDOW_CONTENT_CHANGED
event: The node's content description changed.
Value: 0x00000004
CONTENT_CHANGE_TYPE_PANE_APPEARED
static val CONTENT_CHANGE_TYPE_PANE_APPEARED: Int
Change type for AccessibilityEvent#TYPE_WINDOW_STATE_CHANGED
event: The node has a pane title, and either just appeared or just was assigned a title when it had none before.
Value: 0x00000010
CONTENT_CHANGE_TYPE_PANE_DISAPPEARED
static val CONTENT_CHANGE_TYPE_PANE_DISAPPEARED: Int
Change type for AccessibilityEvent#TYPE_WINDOW_STATE_CHANGED
event: Can mean one of two slightly different things. The primary meaning is that the node has a pane title, and was removed from the node hierarchy. It can also be sent if the pane title is set to null
after it contained a title. No source will be returned if the node is no longer on the screen. To make the change more clear for the user, the first entry in AccessibilityRecord#getText()
can return the value that would have been returned by getSource().getPaneTitle()
.
Value: 0x00000020
CONTENT_CHANGE_TYPE_PANE_TITLE
static val CONTENT_CHANGE_TYPE_PANE_TITLE: Int
Change type for AccessibilityEvent#TYPE_WINDOW_STATE_CHANGED
event: The node's pane title changed.
Value: 0x00000008
CONTENT_CHANGE_TYPE_SUBTREE
static val CONTENT_CHANGE_TYPE_SUBTREE: Int
Change type for TYPE_WINDOW_CONTENT_CHANGED
event: A node in the subtree rooted at the source node was added or removed.
Value: 0x00000001
CONTENT_CHANGE_TYPE_TEXT
static val CONTENT_CHANGE_TYPE_TEXT: Int
Change type for TYPE_WINDOW_CONTENT_CHANGED
event: The node's text changed.
Value: 0x00000002
CONTENT_CHANGE_TYPE_UNDEFINED
static val CONTENT_CHANGE_TYPE_UNDEFINED: Int
Change type for TYPE_WINDOW_CONTENT_CHANGED
event: The type of change is not defined.
Value: 0x00000000
TYPES_ALL_MASK
static val TYPES_ALL_MASK: Int
Mask for AccessibilityEvent
all types.
Value: 0xFFFFFFFF
See Also
AccessibilityEvent#TYPE_VIEW_CLICKEDAccessibilityEvent#TYPE_VIEW_LONG_CLICKEDAccessibilityEvent#TYPE_VIEW_SELECTEDAccessibilityEvent#TYPE_VIEW_FOCUSEDAccessibilityEvent#TYPE_VIEW_TEXT_CHANGEDAccessibilityEvent#TYPE_WINDOW_STATE_CHANGEDAccessibilityEvent#TYPE_NOTIFICATION_STATE_CHANGEDAccessibilityEvent#TYPE_VIEW_HOVER_ENTERAccessibilityEvent#TYPE_VIEW_HOVER_EXITAccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_STARTAccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_ENDAccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGEDAccessibilityEvent#TYPE_VIEW_SCROLLEDAccessibilityEvent#TYPE_VIEW_TEXT_SELECTION_CHANGED#TYPE_ANNOUNCEMENT#TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY#TYPE_GESTURE_DETECTION_START#TYPE_GESTURE_DETECTION_END#TYPE_TOUCH_INTERACTION_START#TYPE_TOUCH_INTERACTION_END#TYPE_WINDOWS_CHANGED#TYPE_VIEW_CONTEXT_CLICKED#TYPE_ASSIST_READING_CONTEXT
TYPE_ANNOUNCEMENT
static val TYPE_ANNOUNCEMENT: Int
Represents the event of an application making an announcement.
Value: 0x00004000
TYPE_ASSIST_READING_CONTEXT
static val TYPE_ASSIST_READING_CONTEXT: Int
Represents the event of the assistant currently reading the users screen context.
Value: 0x01000000
TYPE_GESTURE_DETECTION_END
static val TYPE_GESTURE_DETECTION_END: Int
Represents the event of ending gesture detection.
Value: 0x00080000
TYPE_GESTURE_DETECTION_START
static val TYPE_GESTURE_DETECTION_START: Int
Represents the event of beginning gesture detection.
Value: 0x00040000
TYPE_TOUCH_EXPLORATION_GESTURE_END
static valTYPE_TOUCH_EXPLORATION_GESTURE_END: Int
Deprecated: Use AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_END
directly.
Represents the event of ending a touch exploration gesture.
Value: AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END
TYPE_TOUCH_EXPLORATION_GESTURE_START
static valTYPE_TOUCH_EXPLORATION_GESTURE_START: Int
Deprecated: Use AccessibilityEvent#TYPE_TOUCH_EXPLORATION_GESTURE_START
directly.
Represents the event of starting a touch exploration gesture.
Value: AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START
TYPE_TOUCH_INTERACTION_END
static val TYPE_TOUCH_INTERACTION_END: Int
Represents the event of the user ending to touch the screen.
Value: 0x00200000
TYPE_TOUCH_INTERACTION_START
static val TYPE_TOUCH_INTERACTION_START: Int
Represents the event of the user starting to touch the screen.
Value: 0x00100000
TYPE_VIEW_ACCESSIBILITY_FOCUSED
static val TYPE_VIEW_ACCESSIBILITY_FOCUSED: Int
Represents the event of gaining accessibility focus.
Value: 0x00008000
TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED
static val TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED: Int
Represents the event of clearing accessibility focus.
Value: 0x00010000
TYPE_VIEW_CONTEXT_CLICKED
static val TYPE_VIEW_CONTEXT_CLICKED: Int
Represents the event of a context click on a android.view.View
.
Value: 0x00800000
TYPE_VIEW_HOVER_ENTER
static valTYPE_VIEW_HOVER_ENTER: Int
Deprecated: Use AccessibilityEvent#TYPE_VIEW_HOVER_ENTER
directly.
Represents the event of a hover enter over a android.view.View
.
Value: AccessibilityEvent.TYPE_VIEW_HOVER_ENTER
TYPE_VIEW_HOVER_EXIT
static valTYPE_VIEW_HOVER_EXIT: Int
Deprecated: Use AccessibilityEvent#TYPE_VIEW_HOVER_EXIT
directly.
Represents the event of a hover exit over a android.view.View
.
Value: AccessibilityEvent.TYPE_VIEW_HOVER_EXIT
TYPE_VIEW_SCROLLED
static valTYPE_VIEW_SCROLLED: Int
Deprecated: Use AccessibilityEvent#TYPE_VIEW_SCROLLED
directly.
Represents the event of scrolling a view.
Value: AccessibilityEvent.TYPE_VIEW_SCROLLED
TYPE_VIEW_TEXT_SELECTION_CHANGED
static valTYPE_VIEW_TEXT_SELECTION_CHANGED: Int
Deprecated: Use AccessibilityEvent#TYPE_VIEW_TEXT_SELECTION_CHANGED
directly.
Represents the event of changing the selection in an android.widget.EditText
.
Value: AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED
TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
static val TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY: Int
Represents the event of traversing the text of a view at a given movement granularity.
Value: 0x00020000
TYPE_WINDOWS_CHANGED
static val TYPE_WINDOWS_CHANGED: Int
Represents the event change in the windows shown on the screen.
Value: 0x00400000
TYPE_WINDOW_CONTENT_CHANGED
static valTYPE_WINDOW_CONTENT_CHANGED: Int
Deprecated: Use AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED
directly.
Represents the event of changing the content of a window.
Value: AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
Public methods
appendRecord
static funappendRecord(event: AccessibilityEvent!, record: AccessibilityRecordCompat!): Unit
Deprecated: Use AccessibilityEvent#appendRecord(AccessibilityRecord)
directly.
Appends an android.view.accessibility.AccessibilityRecord
to the end of event records.
Parameters | |
---|---|
record |
AccessibilityEvent!: The record to append. |
Exceptions | |
---|---|
IllegalStateException |
If called from an AccessibilityService. |
asRecord
static funasRecord(event: AccessibilityEvent!): AccessibilityRecordCompat!
Deprecated: Use the AccessibilityEvent
directly as AccessibilityRecord
.
Creates an AccessibilityRecordCompat
from an AccessibilityEvent
that can be used to manipulate the event properties defined in android.view.accessibility.AccessibilityRecord
.
Note: Do not call AccessibilityRecordCompat#recycle()
on the returned AccessibilityRecordCompat
. Call AccessibilityEvent#recycle()
in case you want to recycle the event.
Parameters | |
---|---|
event |
AccessibilityEvent!: The from which to create a record. |
Return | |
---|---|
AccessibilityRecordCompat!: An AccessibilityRecordCompat . |
getAction
static fun getAction(event: AccessibilityEvent!): Int
Gets the performed action that triggered this event.
Return | |
---|---|
Int: The action. |
getContentChangeTypes
static fun getContentChangeTypes(event: AccessibilityEvent!): Int
Gets the bit mask of change types signaled by an TYPE_WINDOW_CONTENT_CHANGED
event. A single event may represent multiple change types.
Return | |
---|---|
Int: The bit mask of change types. One or more of: |
getMovementGranularity
static fun getMovementGranularity(event: AccessibilityEvent!): Int
Gets the movement granularity that was traversed.
Return | |
---|---|
Int: The granularity. |
getRecord
static fungetRecord(event: AccessibilityEvent!, index: Int): AccessibilityRecordCompat!
Deprecated: Use AccessibilityEvent#getRecord(int)
directly.
Gets the record at a given index.
Parameters | |
---|---|
index |
AccessibilityEvent!: The index. |
Return | |
---|---|
AccessibilityRecordCompat!: The record at the specified index. |
getRecordCount
static fungetRecordCount(event: AccessibilityEvent!): Int
Deprecated: Use AccessibilityEvent#getRecordCount()
directly.
Gets the number of records contained in the event.
Return | |
---|---|
Int: The number of records. |
setAction
static fun setAction(event: AccessibilityEvent!, action: Int): Unit
Sets the performed action that triggered this event.
Valid actions are defined in AccessibilityNodeInfoCompat
:
AccessibilityNodeInfoCompat#ACTION_ACCESSIBILITY_FOCUS
AccessibilityNodeInfoCompat#ACTION_CLEAR_ACCESSIBILITY_FOCUS
AccessibilityNodeInfoCompat#ACTION_CLEAR_FOCUS
AccessibilityNodeInfoCompat#ACTION_CLEAR_SELECTION
AccessibilityNodeInfoCompat#ACTION_CLICK
- etc.
Parameters | |
---|---|
action |
AccessibilityEvent!: The action. |
Exceptions | |
---|---|
IllegalStateException |
If called from an AccessibilityService. |
setContentChangeTypes
static fun setContentChangeTypes(event: AccessibilityEvent!, changeTypes: Int): Unit
Sets the bit mask of node tree changes signaled by an TYPE_WINDOW_CONTENT_CHANGED
event.
Parameters | |
---|---|
changeTypes |
AccessibilityEvent!: The bit mask of change types. |
Exceptions | |
---|---|
IllegalStateException |
If called from an AccessibilityService. |
setMovementGranularity
static fun setMovementGranularity(event: AccessibilityEvent!, granularity: Int): Unit
Sets the movement granularity that was traversed.
Parameters | |
---|---|
granularity |
AccessibilityEvent!: The granularity. |
Exceptions | |
---|---|
IllegalStateException |
If called from an AccessibilityService. |