android.support.v4.view.accessibility
Class AccessibilityNodeProviderCompat

java.lang.Object
  extended by android.support.v4.view.accessibility.AccessibilityNodeProviderCompat

public class AccessibilityNodeProviderCompat
extends Object

Helper for accessing AccessibilityNodeProvider introduced after API level 4 in a backwards compatible fashion.


Constructor Summary
AccessibilityNodeProviderCompat()
          Creates a new instance.
AccessibilityNodeProviderCompat(Object provider)
          Creates a new instance wrapping an AccessibilityNodeProvider.
 
Method Summary
 AccessibilityNodeInfoCompat createAccessibilityNodeInfo(int virtualViewId)
          Returns an AccessibilityNodeInfoCompat representing a virtual view, i.e. a descendant of the host View, with the given virtualViewId or the host View itself if virtualViewId equals to View.NO_ID.
 List<AccessibilityNodeInfoCompat> findAccessibilityNodeInfosByText(String text, int virtualViewId)
          Finds AccessibilityNodeInfoCompats by text.
 Object getProvider()
           
 boolean performAction(int virtualViewId, int action, android.os.Bundle arguments)
          Performs an accessibility action on a virtual view, i.e. a descendant of the host View, with the given virtualViewId or the host View itself if virtualViewId equals to View.NO_ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessibilityNodeProviderCompat

public AccessibilityNodeProviderCompat()
Creates a new instance.


AccessibilityNodeProviderCompat

public AccessibilityNodeProviderCompat(Object provider)
Creates a new instance wrapping an AccessibilityNodeProvider.

Parameters:
provider - The provider.
Method Detail

getProvider

public Object getProvider()
Returns:
The wrapped AccessibilityNodeProvider.

createAccessibilityNodeInfo

public AccessibilityNodeInfoCompat createAccessibilityNodeInfo(int virtualViewId)
Returns an AccessibilityNodeInfoCompat representing a virtual view, i.e. a descendant of the host View, with the given virtualViewId or the host View itself if virtualViewId equals to View.NO_ID.

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.

The implementer is responsible for obtaining an accessibility node info from the pool of reusable instances and setting the desired properties of the node info before returning it.

Parameters:
virtualViewId - A client defined virtual view id.
Returns:
A populated AccessibilityNodeInfoCompat for a virtual descendant or the host View.
See Also:
AccessibilityNodeInfoCompat

performAction

public boolean performAction(int virtualViewId,
                             int action,
                             android.os.Bundle arguments)
Performs an accessibility action on a virtual view, i.e. a descendant of the host View, with the given virtualViewId or the host View itself if virtualViewId equals to View.NO_ID.

Parameters:
virtualViewId - A client defined virtual view id.
action - The action to perform.
arguments - Optional arguments.
Returns:
True if the action was performed.
See Also:
createAccessibilityNodeInfo(int), AccessibilityNodeInfoCompat

findAccessibilityNodeInfosByText

public List<AccessibilityNodeInfoCompat> findAccessibilityNodeInfosByText(String text,
                                                                          int virtualViewId)
Finds AccessibilityNodeInfoCompats by text. The match is case insensitive containment. The search is relative to the virtual view, i.e. a descendant of the host View, with the given virtualViewId or the host View itself virtualViewId equals to View.NO_ID.

Parameters:
virtualViewId - A client defined virtual view id which defined the root of the tree in which to perform the search.
text - The searched text.
Returns:
A list of node info.
See Also:
createAccessibilityNodeInfo(int), AccessibilityNodeInfoCompat


Copyright © 2013 Marek Kedzierski. All Rights Reserved.