public final class AccessibilityEventCompat extends Object
AccessibilityEvent
introduced after API level 4 in a backwards compatible fashion.Modifier and Type | Field and Description |
---|---|
static int |
CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION
Change type for
TYPE_WINDOW_CONTENT_CHANGED event:
The node's content description changed. |
static int |
CONTENT_CHANGE_TYPE_SUBTREE
Change type for
TYPE_WINDOW_CONTENT_CHANGED event:
A node in the subtree rooted at the source node was added or removed. |
static int |
CONTENT_CHANGE_TYPE_TEXT
Change type for
TYPE_WINDOW_CONTENT_CHANGED event:
The node's text changed. |
static int |
CONTENT_CHANGE_TYPE_UNDEFINED
Change type for
TYPE_WINDOW_CONTENT_CHANGED event:
The type of change is not defined. |
static int |
TYPE_ANNOUNCEMENT
Represents the event of an application making an announcement.
|
static int |
TYPE_ASSIST_READING_CONTEXT
Represents the event of the assistant currently reading the users screen context.
|
static int |
TYPE_GESTURE_DETECTION_END
Represents the event of ending gesture detection.
|
static int |
TYPE_GESTURE_DETECTION_START
Represents the event of beginning gesture detection.
|
static int |
TYPE_TOUCH_EXPLORATION_GESTURE_END
Represents the event of ending a touch exploration gesture.
|
static int |
TYPE_TOUCH_EXPLORATION_GESTURE_START
Represents the event of starting a touch exploration gesture.
|
static int |
TYPE_TOUCH_INTERACTION_END
Represents the event of the user ending to touch the screen.
|
static int |
TYPE_TOUCH_INTERACTION_START
Represents the event of the user starting to touch the screen.
|
static int |
TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED
Represents the event of clearing accessibility focus.
|
static int |
TYPE_VIEW_ACCESSIBILITY_FOCUSED
Represents the event of gaining accessibility focus.
|
static int |
TYPE_VIEW_CONTEXT_CLICKED
Represents the event of a context click on a
View . |
static int |
TYPE_VIEW_HOVER_ENTER
Represents the event of a hover enter over a
View . |
static int |
TYPE_VIEW_HOVER_EXIT
Represents the event of a hover exit over a
View . |
static int |
TYPE_VIEW_SCROLLED
Represents the event of scrolling a view.
|
static int |
TYPE_VIEW_TEXT_SELECTION_CHANGED
Represents the event of changing the selection in an
EditText . |
static int |
TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
Represents the event of traversing the text of a view at a given movement granularity.
|
static int |
TYPE_WINDOW_CONTENT_CHANGED
Represents the event of changing the content of a window.
|
static int |
TYPE_WINDOWS_CHANGED
Represents the event change in the windows shown on the screen.
|
static int |
TYPES_ALL_MASK
Mask for
AccessibilityEvent all types. |
Modifier and Type | Method and Description |
---|---|
static void |
appendRecord(AccessibilityEvent event,
AccessibilityRecordCompat record)
Appends an
AccessibilityRecord to the end of
event records. |
static AccessibilityRecordCompat |
asRecord(AccessibilityEvent event)
Creates an
AccessibilityRecordCompat from an AccessibilityEvent
that can be used to manipulate the event properties defined in
AccessibilityRecord . |
int |
getAction(AccessibilityEvent event)
Gets the performed action that triggered this event.
|
static int |
getContentChangeTypes(AccessibilityEvent event)
Gets the bit mask of change types signaled by an
TYPE_WINDOW_CONTENT_CHANGED event. |
int |
getMovementGranularity(AccessibilityEvent event)
Gets the movement granularity that was traversed.
|
static AccessibilityRecordCompat |
getRecord(AccessibilityEvent event,
int index)
Gets the record at a given index.
|
static int |
getRecordCount(AccessibilityEvent event)
Gets the number of records contained in the event.
|
void |
setAction(AccessibilityEvent event,
int action)
Sets the performed action that triggered this event.
|
static void |
setContentChangeTypes(AccessibilityEvent event,
int changeTypes)
Sets the bit mask of node tree changes signaled by an
TYPE_WINDOW_CONTENT_CHANGED event. |
void |
setMovementGranularity(AccessibilityEvent event,
int granularity)
Sets the movement granularity that was traversed.
|
public static final int TYPE_VIEW_HOVER_ENTER
View
.public static final int TYPE_VIEW_HOVER_EXIT
View
.public static final int TYPE_TOUCH_EXPLORATION_GESTURE_START
public static final int TYPE_TOUCH_EXPLORATION_GESTURE_END
public static final int TYPE_WINDOW_CONTENT_CHANGED
public static final int TYPE_VIEW_SCROLLED
public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED
EditText
.public static final int TYPE_ANNOUNCEMENT
public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED
public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED
public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
public static final int TYPE_GESTURE_DETECTION_START
public static final int TYPE_GESTURE_DETECTION_END
public static final int TYPE_TOUCH_INTERACTION_START
public static final int TYPE_TOUCH_INTERACTION_END
public static final int TYPE_WINDOWS_CHANGED
public static final int TYPE_VIEW_CONTEXT_CLICKED
View
.public static final int TYPE_ASSIST_READING_CONTEXT
public static final int CONTENT_CHANGE_TYPE_UNDEFINED
TYPE_WINDOW_CONTENT_CHANGED
event:
The type of change is not defined.public static final int CONTENT_CHANGE_TYPE_SUBTREE
TYPE_WINDOW_CONTENT_CHANGED
event:
A node in the subtree rooted at the source node was added or removed.public static final int CONTENT_CHANGE_TYPE_TEXT
TYPE_WINDOW_CONTENT_CHANGED
event:
The node's text changed.public static final int CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION
TYPE_WINDOW_CONTENT_CHANGED
event:
The node's content description changed.public static final int TYPES_ALL_MASK
AccessibilityEvent
all types.AccessibilityEvent.TYPE_VIEW_CLICKED
,
AccessibilityEvent.TYPE_VIEW_LONG_CLICKED
,
AccessibilityEvent.TYPE_VIEW_SELECTED
,
AccessibilityEvent.TYPE_VIEW_FOCUSED
,
AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED
,
AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
,
AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED
,
TYPE_VIEW_HOVER_ENTER
,
TYPE_VIEW_HOVER_EXIT
,
TYPE_TOUCH_EXPLORATION_GESTURE_START
,
TYPE_TOUCH_EXPLORATION_GESTURE_END
,
TYPE_WINDOW_CONTENT_CHANGED
,
TYPE_VIEW_SCROLLED
,
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
,
Constant Field Valuespublic static int getRecordCount(AccessibilityEvent event)
public static void appendRecord(AccessibilityEvent event, AccessibilityRecordCompat record)
AccessibilityRecord
to the end of
event records.record
- The record to append.IllegalStateException
- If called from an AccessibilityService.public static AccessibilityRecordCompat getRecord(AccessibilityEvent event, int index)
index
- The index.public static AccessibilityRecordCompat asRecord(AccessibilityEvent event)
AccessibilityRecordCompat
from an AccessibilityEvent
that can be used to manipulate the event properties defined in
AccessibilityRecord
.
Note: Do not call AccessibilityRecordCompat.recycle()
on the
returned AccessibilityRecordCompat
. Call AccessibilityEvent.recycle()
in case you want to recycle the event.
event
- The from which to create a record.AccessibilityRecordCompat
.public static void setContentChangeTypes(AccessibilityEvent event, int changeTypes)
TYPE_WINDOW_CONTENT_CHANGED
event.changeTypes
- The bit mask of change types.IllegalStateException
- If called from an AccessibilityService.getContentChangeTypes(AccessibilityEvent)
public static int getContentChangeTypes(AccessibilityEvent event)
TYPE_WINDOW_CONTENT_CHANGED
event. A single event may represent
multiple change types.public void setMovementGranularity(AccessibilityEvent event, int granularity)
granularity
- The granularity.IllegalStateException
- If called from an AccessibilityService.public int getMovementGranularity(AccessibilityEvent event)
public void setAction(AccessibilityEvent event, int action)
Valid actions are defined in AccessibilityNodeInfoCompat
:
action
- The action.IllegalStateException
- If called from an AccessibilityService.AccessibilityNodeInfoCompat.performAction(int)
public int getAction(AccessibilityEvent event)