FileDocCategorySizeDatePackage
AccessibilityNodeProviderCompat.javaAPI DocAndroid 5.1 API10400Thu Mar 12 22:22:56 GMT 2015android.support.v4.view.accessibility

AccessibilityNodeProviderCompat

public class AccessibilityNodeProviderCompat extends Object
Helper for accessing {@link android.view.accessibility.AccessibilityNodeProvider} introduced after API level 4 in a backwards compatible fashion.

Fields Summary
private static final AccessibilityNodeProviderImpl
IMPL
private final Object
mProvider
Constructors Summary
public AccessibilityNodeProviderCompat()
Creates a new instance.

        if (Build.VERSION.SDK_INT >= 19) { // KitKat
            IMPL = new AccessibilityNodeProviderKitKatImpl();
        } else if (Build.VERSION.SDK_INT >= 16) { // JellyBean
            IMPL = new AccessibilityNodeProviderJellyBeanImpl();
        } else {
            IMPL = new AccessibilityNodeProviderStubImpl();
        }
    
        mProvider = IMPL.newAccessibilityNodeProviderBridge(this);
    
public AccessibilityNodeProviderCompat(Object provider)
Creates a new instance wrapping an {@link android.view.accessibility.AccessibilityNodeProvider}.

param
provider The provider.

        mProvider = provider;
    
Methods Summary
public AccessibilityNodeInfoCompatcreateAccessibilityNodeInfo(int virtualViewId)
Returns an {@link 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 {@link 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.

param
virtualViewId A client defined virtual view id.
return
A populated {@link AccessibilityNodeInfoCompat} for a virtual descendant or the host View.
see
AccessibilityNodeInfoCompat

        return null;
    
public java.util.ListfindAccessibilityNodeInfosByText(java.lang.String text, int virtualViewId)
Finds {@link AccessibilityNodeInfoCompat}s 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 {@link View#NO_ID}.

param
virtualViewId A client defined virtual view id which defined the root of the tree in which to perform the search.
param
text The searched text.
return
A list of node info.
see
#createAccessibilityNodeInfo(int)
see
AccessibilityNodeInfoCompat

        return null;
    
public AccessibilityNodeInfoCompatfindFocus(int focus)
Find the virtual view, i.e. a descendant of the host View, that has the specified focus type.

param
focus The focus to find. One of {@link AccessibilityNodeInfoCompat#FOCUS_INPUT} or {@link AccessibilityNodeInfoCompat#FOCUS_ACCESSIBILITY}.
return
The node info of the focused view or null.
see
AccessibilityNodeInfoCompat#FOCUS_INPUT
see
AccessibilityNodeInfoCompat#FOCUS_ACCESSIBILITY

        return null;
    
public java.lang.ObjectgetProvider()

return
The wrapped {@link android.view.accessibility.AccessibilityNodeProvider}.

        return mProvider;
    
public booleanperformAction(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 {@link View#NO_ID}.

param
virtualViewId A client defined virtual view id.
param
action The action to perform.
param
arguments Optional arguments.
return
True if the action was performed.
see
#createAccessibilityNodeInfo(int)
see
AccessibilityNodeInfoCompat

        return false;