Android.Views.Accessibility.AccessibilityEvent Class

Developer Guides

View text traversed at movement granularity - represents the event of traversing the text of a view at a given granularity.

See Also: AccessibilityEvent Members

Syntax

[Android.Runtime.Register("android/view/accessibility/AccessibilityEvent", DoNotGenerateAcw=true)]
public sealed class AccessibilityEvent : AccessibilityRecord, Android.OS.IParcelable, IDisposable

Remarks

Developer Guides

View text traversed at movement granularity - represents the event of traversing the text of a view at a given granularity. For example, moving to the next word.
Type:AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
Properties:

This class represents accessibility events that are sent by the system when something notable happens in the user interface. For example, when a Android.Widget.Button is clicked, a Android.Views.View is focused, etc.

An accessibility event is fired by an individual view which populates the event with data for its state and requests from its parent to send the event to interested parties. The parent can optionally add an Android.Views.Accessibility.AccessibilityRecord for itself before dispatching a similar request to its parent. A parent can also choose not to respect the request for sending an event. The accessibility event is sent by the topmost view in the view tree. Therefore, an Android.AccessibilityServices.AccessibilityService can explore all records in an accessibility event to obtain more information about the context in which the event was fired.

The main purpose of an accessibility event is to expose enough information for an Android.AccessibilityServices.AccessibilityService to provide meaningful feedback to the user. Sometimes however, an accessibility service may need more contextual information then the one in the event pay-load. In such cases the service can obtain the event source which is an Android.Views.Accessibility.AccessibilityNodeInfo (snapshot of a View state) which can be used for exploring the window content. Note that the privilege for accessing an event's source, thus the window content, has to be explicitly requested. For more details refer to Android.AccessibilityServices.AccessibilityService. If an accessibility service has not requested to retrieve the window content the event will not contain reference to its source. Also for events of type AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED the source is never available.

This class represents various semantically different accessibility event types. Each event type has an associated set of related properties. In other words, each event type is characterized via a subset of the properties exposed by this class. For each event type there is a corresponding constant defined in this class. Follows a specification of the event types and their associated properties:

For more information about creating and processing AccessibilityEvents, read the Accessibility developer guide.

VIEW TYPES

View clicked - represents the event of clicking on a Android.Views.View like Android.Widget.Button, Android.Widget.CompoundButton, etc.
Type:AccessibilityEvent.TYPE_VIEW_CLICKED
Properties:

View long clicked - represents the event of long clicking on a Android.Views.View like Android.Widget.Button, Android.Widget.CompoundButton, etc
Type:AccessibilityEvent.TYPE_VIEW_LONG_CLICKED
Properties:

View selected - represents the event of selecting an item usually in the context of an Android.Widget.AdapterView.
Type:AccessibilityEvent.TYPE_VIEW_SELECTED
Properties:

View focused - represents the event of focusing a Android.Views.View.
Type:AccessibilityEvent.TYPE_VIEW_FOCUSED
Properties:

View text changed - represents the event of changing the text of an Android.Widget.EditText.
Type:AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED
Properties:

View text selection changed - represents the event of changing the text selection of an Android.Widget.EditText.
Type:AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED
Properties:

View scrolled - represents the event of scrolling a view. If the source is a descendant of Android.Widget.AdapterView the scroll is reported in terms of visible items - the first visible item, the last visible item, and the total items - because the the source is unaware of its pixel size since its adapter is responsible for creating views. In all other cases the scroll is reported as the current scroll on the X and Y axis respectively plus the height of the source in pixels.
Type:AccessibilityEvent.TYPE_VIEW_SCROLLED
Properties:

Note: This event type is not dispatched to descendants though Android.Views.View.DispatchPopulateAccessibilityEvent(AccessibilityEvent), hence the event source Android.Views.View and the sub-tree rooted at it will not receive calls to Android.Views.View.OnPopulateAccessibilityEvent(AccessibilityEvent). The preferred way to add text content to such events is by setting the NoType:android/R$styleable;Href=../../../../reference/android/R.styleable.html#View_contentDescription of the source view.

TRANSITION TYPES

Window state changed - represents the event of opening a Android.Widget.PopupWindow, Android.Views.Menu, Android.App.Dialog, etc.
Type:AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
Properties:

Window content changed - represents the event of change in the content of a window. This change can be adding/removing view, changing a view size, etc.

Note: This event is fired only for the window source of the last accessibility event different from AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED and its purpose is to notify clients that the content of the user interaction window has changed.
Type:AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
Properties:

Note: This event type is not dispatched to descendants though Android.Views.View.DispatchPopulateAccessibilityEvent(AccessibilityEvent), hence the event source Android.Views.View and the sub-tree rooted at it will not receive calls to Android.Views.View.OnPopulateAccessibilityEvent(AccessibilityEvent). The preferred way to add text content to such events is by setting the NoType:android/R$styleable;Href=../../../../reference/android/R.styleable.html#View_contentDescription of the source view.

Windows changed - represents the event of changes in the windows shown on the screen such as a window appeared, a window disappeared, a window size changed, a window layer changed, etc.
Type:AccessibilityEvent.TYPE_WINDOWS_CHANGED
Properties:

Note: You can retrieve the Android.Views.Accessibility.AccessibilityWindowInfo for the window source of the event via AccessibilityRecord.Source to get the source node on which then call AccessibilityNodeInfo.Window to get the window. Also all windows on the screen can be retrieved by a call to Android.AccessibilityServices.AccessibilityService.Windows.

NOTIFICATION TYPES

Notification state changed - represents the event showing Android.App.Notification.
Type:AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED
Properties:

Note: This event type is not dispatched to descendants though Android.Views.View.DispatchPopulateAccessibilityEvent(AccessibilityEvent), hence the event source Android.Views.View and the sub-tree rooted at it will not receive calls to Android.Views.View.OnPopulateAccessibilityEvent(AccessibilityEvent). The preferred way to add text content to such events is by setting the NoType:android/R$styleable;Href=../../../../reference/android/R.styleable.html#View_contentDescription of the source view.

EXPLORATION TYPES

View hover enter - represents the event of beginning to hover over a Android.Views.View. The hover may be generated via exploring the screen by touch or via a pointing device.
Type:AccessibilityEvent.TYPE_VIEW_HOVER_ENTER
Properties:

View hover exit - represents the event of stopping to hover over a Android.Views.View. The hover may be generated via exploring the screen by touch or via a pointing device.
Type:AccessibilityEvent.TYPE_VIEW_HOVER_EXIT
Properties:
Touch interaction start - represents the event of starting a touch interaction, which is the user starts touching the screen.

Type:AccessibilityEvent.TYPE_TOUCH_INTERACTION_START
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.
Touch interaction end - represents the event of ending a touch interaction, which is the user stops touching the screen.

Type:AccessibilityEvent.TYPE_TOUCH_INTERACTION_END
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.
Touch exploration gesture start - represents the event of starting a touch exploring gesture.

Type:AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.
Touch exploration gesture end - represents the event of ending a touch exploring gesture.

Type:AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.
Touch gesture detection start - represents the event of starting a user gesture detection.

Type:AccessibilityEvent.TYPE_GESTURE_DETECTION_START
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.
Touch gesture detection end - represents the event of ending a user gesture detection.

Type:AccessibilityEvent.TYPE_GESTURE_DETECTION_END
Properties:

Note: This event is fired only by the system and is not passed to the view tree to be populated.
MISCELLANEOUS TYPES

Announcement - represents the event of an application making an announcement. Usually this announcement is related to some sort of a context change for which none of the events representing UI transitions is a good fit. For example, announcing a new page in a book.
Type:AccessibilityEvent.TYPE_ANNOUNCEMENT
Properties:

Security note

Since an event contains the text of its source privacy can be compromised by leaking sensitive information such as passwords. To address this issue any event fired in response to manipulation of a PASSWORD field does NOT CONTAIN the text of the password.

See Also

[Android Documentation]

Requirements

Namespace: Android.Views.Accessibility
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 4