Java Code Examples for android.view.View#getAccessibilityNodeProvider()

The following examples show how to use android.view.View#getAccessibilityNodeProvider() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutofillManager.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private AccessibilityNodeInfo findVirtualNodeByAccessibilityId(View view, int virtualId) {
    final AccessibilityNodeProvider provider = view.getAccessibilityNodeProvider();
    if (provider == null) {
        return null;
    }
    return provider.createAccessibilityNodeInfo(virtualId);
}
 
Example 2
Source File: ViewCompatJB.java    From letv with Apache License 2.0 4 votes vote down vote up
public static Object getAccessibilityNodeProvider(View view) {
    return view.getAccessibilityNodeProvider();
}
 
Example 3
Source File: ViewAccessibilityUtils.java    From Accessibility-Test-Framework-for-Android with Apache License 2.0 4 votes vote down vote up
/** See {@link View#isImportantForAccessibility()}. */
public static boolean isImportantForAccessibility(View view) {
  if (view == null) {
    return false;
  }

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    return view.isImportantForAccessibility();
  } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
    // Prior to Jelly Bean, all Views were considered important for accessibility.
    return true;
  } else {
    // On APIs between 16 and 21, we must piece together accessibility importance from the
    // available properties. We return false incorrectly for some cases where unretrievable
    // listeners prevent us from determining importance.

    // If the developer marked the view as explicitly not important, it isn't.
    int mode = view.getImportantForAccessibility();
    if ((mode == View.IMPORTANT_FOR_ACCESSIBILITY_NO)
        || (mode == View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS)) {
      return false;
    }

    // No parent view can be hiding us. (APIs 19 to 21)
    ViewParent parent = view.getParent();
    while (parent instanceof View) {
      if (((View) parent).getImportantForAccessibility()
          == View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS) {
        return false;
      }
      parent = parent.getParent();
    }

    // Interrogate the view's other properties to determine importance.
    return (mode == View.IMPORTANT_FOR_ACCESSIBILITY_YES)
        || isActionableForAccessibility(view)
        || hasListenersForAccessibility(view)
        || (view.getAccessibilityNodeProvider() != null)
        || (ViewCompat.getAccessibilityLiveRegion(view)
            != ViewCompat.ACCESSIBILITY_LIVE_REGION_NONE);
  }
}
 
Example 4
Source File: am.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public static Object d(View view)
{
    return view.getAccessibilityNodeProvider();
}
 
Example 5
Source File: ViewCompatJB.java    From CodenameOne with GNU General Public License v2.0 4 votes vote down vote up
public static Object getAccessibilityNodeProvider(View view) {
    return view.getAccessibilityNodeProvider();
}
 
Example 6
Source File: ViewCompatJB.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static Object getAccessibilityNodeProvider(View view) {
    return view.getAccessibilityNodeProvider();
}
 
Example 7
Source File: ViewCompatJB.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
public static Object getAccessibilityNodeProvider(View view) {
    return view.getAccessibilityNodeProvider();
}
 
Example 8
Source File: ViewCompatJB.java    From guideshow with MIT License 4 votes vote down vote up
public static Object getAccessibilityNodeProvider(View view) {
    return view.getAccessibilityNodeProvider();
}