Skip to content

Commit

Permalink
fbandroid/libraries/components/litho-editor-flipper/src/main/java/com…
Browse files Browse the repository at this point in the history
…/facebook/litho/editor/flipper/LithoViewDescriptor.java

Reviewed By: pengj

Differential Revision: D66458035

fbshipit-source-id: 72919be3dae30d00c29e5223ba5c7ef4adcc0eb4
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Nov 27, 2024
1 parent bae0702 commit 8b5a9aa
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
import com.facebook.flipper.plugins.inspector.NodeDescriptor;
import com.facebook.flipper.plugins.inspector.SetDataOperations;
import com.facebook.flipper.plugins.inspector.Touch;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.litho.BaseMountingView;
import com.facebook.litho.DebugComponent;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;

@Nullsafe(Nullsafe.Mode.LOCAL)
public class LithoViewDescriptor extends NodeDescriptor<BaseMountingView> {

@Override
Expand All @@ -48,18 +50,21 @@ public void onDirtyMount(BaseMountingView view) {
@Override
public String getId(BaseMountingView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getId(node);
}

@Override
public String getName(BaseMountingView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getName(node);
}

@Override
public String getAXName(BaseMountingView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getAXName(node);
}

Expand All @@ -71,17 +76,20 @@ public int getChildCount(BaseMountingView node) {
@Override
public int getAXChildCount(BaseMountingView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getAXChildCount(node);
}

@Override
public Object getChildAt(BaseMountingView node, int index) {
// NULLSAFE_FIXME[Return Not Nullable]
return DebugComponent.getRootInstance(node);
}

@Override
public @Nullable Object getAXChildAt(BaseMountingView node, int index) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getChildAt(node, index);
}

Expand All @@ -105,6 +113,7 @@ public List<Named<FlipperObject>> getData(BaseMountingView node) throws Exceptio
.put("bottom", mountedBounds.bottom))
.build()));

// NULLSAFE_FIXME[Nullable Dereference]
props.addAll(descriptor.getData(node));

return props;
Expand All @@ -114,6 +123,7 @@ public List<Named<FlipperObject>> getData(BaseMountingView node) throws Exceptio
public List<Named<FlipperObject>> getAXData(BaseMountingView node) throws Exception {
final List<Named<FlipperObject>> props = new ArrayList<>();
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
props.addAll(descriptor.getAXData(node));
return props;
}
Expand All @@ -126,31 +136,36 @@ public void setValue(
FlipperDynamic value)
throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
descriptor.setValue(node, path, kind, value);
}

@Override
public List<Named<String>> getAttributes(BaseMountingView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getAttributes(node);
}

@Override
public List<Named<String>> getAXAttributes(BaseMountingView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getAXAttributes(node);
}

@Override
public FlipperObject getExtraInfo(BaseMountingView node) {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getExtraInfo(node);
}

@Override
public void setHighlighted(BaseMountingView node, boolean selected, boolean isAlignmentMode)
throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
descriptor.setHighlighted(node, selected, isAlignmentMode);
}

Expand All @@ -172,24 +187,28 @@ public void hitTest(BaseMountingView node, Touch touch) {
@Override
public void axHitTest(BaseMountingView node, Touch touch) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
descriptor.axHitTest(node, touch);
}

@Override
public String getDecoration(BaseMountingView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getDecoration(node);
}

@Override
public String getAXDecoration(BaseMountingView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(ViewGroup.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.getAXDecoration(node);
}

@Override
public boolean matches(String query, BaseMountingView node) throws Exception {
NodeDescriptor descriptor = descriptorForClass(Object.class);
// NULLSAFE_FIXME[Nullable Dereference]
return descriptor.matches(query, node);
}
}

0 comments on commit 8b5a9aa

Please sign in to comment.