in layout-hierarchy-litho/src/main/java/com/facebook/testing/screenshot/layouthierarchy/litho/LithoAttributePlugin.java [49:71]
public void putAttributes(JSONObject node, Object obj, Point offset) throws JSONException {
final DebugComponent debugComponent;
if (obj instanceof LithoView) {
((LithoView) obj).rebind();
debugComponent = DebugComponent.getRootInstance((LithoView) obj);
if (debugComponent == null) {
return;
}
} else {
debugComponent = (DebugComponent) obj;
// Since we're dealing with a pure component, we cant rely on the default required
// attributes to be added, so we add them here
Rect bounds = debugComponent.getBoundsInLithoView();
putRequired(
node,
debugComponent.getComponent().getClass().getName(),
offset.x + bounds.left,
offset.y + bounds.top,
bounds.width(),
bounds.height());
}
}