Example usage for com.facebook.react.uimanager ReactShadowNode getReactTag

List of usage examples for com.facebook.react.uimanager ReactShadowNode getReactTag

Introduction

In this page you can find the example usage for com.facebook.react.uimanager ReactShadowNode getReactTag.

Prototype

int getReactTag();

Source Link

Usage

From source file:com.horcrux.svg.GroupShadowNode.java

License:Open Source License

@Override
public int hitTest(final Point point, final @Nullable Matrix matrix) {
    int hitSelf = super.hitTest(point, matrix);
    if (hitSelf != -1) {
        return hitSelf;
    }/*from  ww  w  .j a va 2 s.  c o m*/

    Matrix groupMatrix = new Matrix(mMatrix);

    if (matrix != null) {
        groupMatrix.postConcat(matrix);
    }

    Path clipPath = getClipPath();

    if (clipPath != null && !pathContainsPoint(clipPath, groupMatrix, point)) {
        return -1;
    }

    for (int i = getChildCount() - 1; i >= 0; i--) {
        ReactShadowNode child = getChildAt(i);
        if (!(child instanceof VirtualNode)) {
            continue;
        }

        VirtualNode node = (VirtualNode) child;

        int hitChild = node.hitTest(point, groupMatrix);
        if (hitChild != -1) {
            return (node.isResponsible() || hitChild != child.getReactTag()) ? hitChild : getReactTag();
        }
    }

    return -1;
}