Example usage for android.support.v4.view.accessibility AccessibilityWindowInfoCompat getBoundsInScreen

List of usage examples for android.support.v4.view.accessibility AccessibilityWindowInfoCompat getBoundsInScreen

Introduction

In this page you can find the example usage for android.support.v4.view.accessibility AccessibilityWindowInfoCompat getBoundsInScreen.

Prototype

public void getBoundsInScreen(Rect outBounds) 

Source Link

Document

Gets the bounds of this window in the screen.

Usage

From source file:com.android.utils.AccessibilityNodeInfoUtils.java

/**
 * Determines whether the specified node has bounds identical to the bounds of its window.
 *//*from   ww  w. jav a 2  s .  c o m*/
private static boolean areBoundsIdenticalToWindow(AccessibilityNodeInfoCompat node) {
    if (node == null) {
        return false;
    }

    AccessibilityWindowInfoCompat window = node.getWindow();
    if (window == null) {
        return false;
    }

    Rect windowBounds = new Rect();
    window.getBoundsInScreen(windowBounds);

    Rect nodeBounds = new Rect();
    node.getBoundsInScreen(nodeBounds);

    return windowBounds.equals(nodeBounds);
}