private synchronized RibView buildRibViewRecursive()

in tooling/rib-intellij-plugin/native/intellij-broadcast-rib/src/main/java/com/uber/debug/broadcast/rib/RibHierarchyDebugBroadcastHandler.java [190:207]


  private synchronized RibView buildRibViewRecursive(
      View view, @Nullable TargetInfo targetInfo, int depth) {
    RibView ribView = buildRibView(view);

    if (targetInfo != null
        && depth > targetInfo.viewDepth
        && viewIncludesTarget(view, targetInfo.targetX, targetInfo.targetY)) {
      targetInfo.setView(ribView, depth);
    }

    if (view instanceof ViewGroup) {
      for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
        View child = ((ViewGroup) view).getChildAt(i);
        ribView.addChildren(buildRibViewRecursive(child, targetInfo, depth + 1));
      }
    }
    return ribView;
  }