Android.Views.Accessibility.AccessibilityNodeProvider Class
This class is the contract a client should implement to enable support of a virtual view hierarchy rooted at a given view for accessibility purposes.

See Also: AccessibilityNodeProvider Members

Syntax

[Android.Runtime.Register("android/view/accessibility/AccessibilityNodeProvider", DoNotGenerateAcw=true)]
public abstract class AccessibilityNodeProvider : Java.Lang.Object

Remarks

This class is the contract a client should implement to enable support of a virtual view hierarchy rooted at a given view for accessibility purposes. A virtual view hierarchy is a tree of imaginary Views that is reported as a part of the view hierarchy when an Android.AccessibilityServices.AccessibilityService explores the window content. Since the virtual View tree does not exist this class is responsible for managing the Android.Views.Accessibility.AccessibilityNodeInfos describing that tree to accessibility services.

The main use case of these APIs is to enable a custom view that draws complex content, for example a monthly calendar grid, to be presented as a tree of logical nodes, for example month days each containing events, thus conveying its logical structure.

java Example

     getAccessibilityNodeProvider(
         if (mAccessibilityNodeProvider == null) {
             mAccessibilityNodeProvider = new AccessibilityNodeProvider() {
                 public boolean performAction(int action, int virtualDescendantId) {
                     // Implementation.
                     return false;
                 }

                 public List findAccessibilityNodeInfosByText(String text,
                         int virtualDescendantId) {
                     // Implementation.
                     return null;
                 }

                 public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualDescendantId) {
                     // Implementation.
                     return null;
                 }
             });
     return mAccessibilityNodeProvider;
 

A typical use case is to override Android.Views.View.AccessibilityNodeProvider of the View that is a root of a virtual View hierarchy to return an instance of this class. In such a case this instance is responsible for managing Android.Views.Accessibility.AccessibilityNodeInfos describing the virtual sub-tree rooted at the View including the one representing the View itself. Similarly the returned instance is responsible for performing accessibility actions on any virtual view or the root view itself. For example:

[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 16