in layout-hierarchy-litho/src/main/java/com/facebook/testing/screenshot/layouthierarchy/litho/LithoHierarchyPlugin.java [46:66]
public void putHierarchy(LayoutHierarchyDumper dumper, JSONObject root, Object obj, Point offset)
throws JSONException {
if (!accept(obj)) {
return;
}
if (obj instanceof LithoView) {
LithoView lithoView = (LithoView) obj;
DebugComponent debugComponent = DebugComponent.getRootInstance(lithoView);
if (debugComponent == null) {
return;
}
final int offsetLeft = LayoutHierarchyDumper.getViewLeft(lithoView);
final int offsetTop = LayoutHierarchyDumper.getViewTop(lithoView);
offset.offset(offsetLeft, offsetTop);
dumpHierarchy(dumper, root, debugComponent, offset);
offset.offset(-offsetLeft, -offsetTop);
} else {
dumpHierarchy(dumper, root, (DebugComponent) obj, offset);
}
}