FileDocCategorySizeDatePackage
AccessibilityNodeInfoHelper.javaAPI DocAndroid 5.1 API1679Thu Mar 12 22:22:08 GMT 2015com.android.uiautomator.core

AccessibilityNodeInfoHelper

public class AccessibilityNodeInfoHelper extends Object
This class contains static helper methods to work with {@link AccessibilityNodeInfo}

Fields Summary
Constructors Summary
Methods Summary
static android.graphics.RectgetVisibleBoundsInScreen(android.view.accessibility.AccessibilityNodeInfo node, int width, int height)
Returns the node's bounds clipped to the size of the display

param
node
param
width pixel width of the display
param
height pixel height of the display
return
null if node is null, else a Rect containing visible bounds

        if (node == null) {
            return null;
        }
        // targeted node's bounds
        Rect nodeRect = new Rect();
        node.getBoundsInScreen(nodeRect);

        Rect displayRect = new Rect();
        displayRect.top = 0;
        displayRect.left = 0;
        displayRect.right = width;
        displayRect.bottom = height;

        nodeRect.intersect(displayRect);
        return nodeRect;