public final class DebugComponent extends Object
Component
or a ComponentLayout
. The purpose of this class is for tools such as
Stetho's UI inspector to be able to easily visualize a component hierarchy without worrying about
implementation details of Litho.Modifier and Type | Class and Description |
---|---|
static interface |
DebugComponent.Overrider |
public boolean isValidInstance()
@Nullable public static DebugComponent getRootInstance(LithoView view)
DebugComponent
of a LithoView. This should be the start of your
traversal.@Nullable public static DebugComponent getRootInstance(@Nullable ComponentTree componentTree)
public String getName()
public String getSimpleName()
public Class getComponentClass()
public void setOverrider(DebugComponent.Overrider overrider)
public List<DebugComponent> getChildComponents()
View
s
that are mounted by this component as those are not components.
Use this#getMountedView
for that.@Nullable public View getMountedView()
@Nullable public Drawable getMountedDrawable()
@Nullable public LithoView getLithoView()
public Rect getBoundsInLithoView()
LithoView
.public Rect getBounds()
public ComponentContext getContext()
ComponentContext
for this component.public boolean isLayoutNode()
@Nullable public String getTestKey()
@Nullable public String getTextContent()
@Nullable public ComponentHost getComponentHost()
ComponentHost
that wraps this component or null if one cannot be found.@Nullable public String getKey()
@Nullable public Component getComponent()
@Nullable public YogaNode getYogaNode()
@Nullable public Drawable getForeground()
@Nullable public Reference<? extends Drawable> getBackground()
@Nullable public Integer getImportantForAccessibility()
public boolean getFocusable()
@Nullable public CharSequence getContentDescription()
public void rerender()
public void setBackgroundColor(int color)
public void setForegroundColor(int color)
public void setLayoutDirection(YogaDirection yogaDirection)
public void setFlexDirection(YogaFlexDirection direction)
public void setJustifyContent(YogaJustify yogaJustify)
public void setAlignItems(YogaAlign yogaAlign)
public void setAlignSelf(YogaAlign yogaAlign)
public void setAlignContent(YogaAlign yogaAlign)
public void setPositionType(YogaPositionType yogaPositionType)
public void setFlexGrow(float value)
public void setFlexShrink(float value)
public void setFlexBasis(YogaValue value)
public void setWidth(YogaValue value)
public void setMinWidth(YogaValue value)
public void setMaxWidth(YogaValue value)
public void setHeight(YogaValue value)
public void setMinHeight(YogaValue value)
public void setMaxHeight(YogaValue value)
public void setAspectRatio(float aspectRatio)
public void setBorderWidth(YogaEdge edge, float value)
public void setContentDescription(CharSequence contentDescription)
public void setImportantForAccessibility(int importantForAccessibility)
public void setFocusable(boolean focusable)
@Nullable public ComponentLifecycle.StateContainer getStateContainer()
public String getId()
@Nullable public EventHandler getClickHandler()