List of usage examples for android.support.v4.view.accessibility AccessibilityNodeInfoCompat findAccessibilityNodeInfosByText
public List<AccessibilityNodeInfoCompat> findAccessibilityNodeInfosByText(String text)
From source file:com.android.utils.AutomationUtils.java
/** * Returns a list of nodes under the {@code root} node that match the * class specified by {@code className} and exactly match the text or * content description specified by {@code text}. */// ww w.j a v a2s . c o m private static List<AccessibilityNodeInfoCompat> findViewsWithText(AccessibilityNodeInfoCompat root, CharSequence className, String text) { final List<AccessibilityNodeInfoCompat> nodes = root.findAccessibilityNodeInfosByText(text); final List<AccessibilityNodeInfoCompat> results = new LinkedList<>(); for (AccessibilityNodeInfoCompat node : nodes) { if (nodeMatchesFilter(node, className, text)) { results.add(node); } } return Collections.unmodifiableList(results); }
From source file:com.google.android.marvin.utils.AutomationUtils.java
/** * Returns a list of nodes under the {@code root} node that match the * class specified by {@code className} and exactly match the text or * content description specified by {@code text}. *///from w w w . j ava 2 s. c om private static List<AccessibilityNodeInfoCompat> findViewsWithText(Context context, AccessibilityNodeInfoCompat root, CharSequence className, String text) { final List<AccessibilityNodeInfoCompat> nodes = root.findAccessibilityNodeInfosByText(text); final List<AccessibilityNodeInfoCompat> results = new LinkedList<AccessibilityNodeInfoCompat>(); for (AccessibilityNodeInfoCompat node : nodes) { if (nodeMatchesFilter(context, node, className, text)) { results.add(node); } } return Collections.unmodifiableList(results); }