public class LithoLayoutResult extends java.lang.Object implements ComponentLayout, LayoutResult
LayoutResult for Litho. This holds a reference to
the LithoNode which created it, its YogaNode, and a list of its children.| Constructor and Description |
|---|
LithoLayoutResult(ComponentContext c,
LithoNode node,
YogaNode yogaNode,
LithoLayoutResult parent) |
protected final LithoNode mNode
public LithoLayoutResult(ComponentContext c, LithoNode node, YogaNode yogaNode, LithoLayoutResult parent)
public ComponentContext getContext()
public int getX()
getX in interface ComponentLayoutpublic int getY()
getY in interface ComponentLayoutpublic int getWidth()
getWidth in interface ComponentLayoutgetWidth in interface LayoutResultpublic int getHeight()
getHeight in interface ComponentLayoutgetHeight in interface LayoutResultpublic int getPaddingTop()
getPaddingTop in interface ComponentLayoutgetPaddingTop in interface LayoutResultpublic int getPaddingRight()
getPaddingRight in interface ComponentLayoutgetPaddingRight in interface LayoutResultpublic int getPaddingBottom()
getPaddingBottom in interface ComponentLayoutgetPaddingBottom in interface LayoutResultpublic int getPaddingLeft()
getPaddingLeft in interface ComponentLayoutgetPaddingLeft in interface LayoutResultpublic int getWidthSpec()
getWidthSpec in interface LayoutResultpublic int getHeightSpec()
getHeightSpec in interface LayoutResultpublic boolean isPaddingSet()
isPaddingSet in interface ComponentLayoutpublic Drawable getBackground()
getBackground in interface ComponentLayoutpublic YogaDirection getResolvedLayoutDirection()
getResolvedLayoutDirection in interface ComponentLayoutpublic LithoNode getNode()
public boolean shouldDrawBorders()
public int getLayoutBorder(YogaEdge edge)
public int getTouchExpansionBottom()
public int getTouchExpansionLeft()
public int getTouchExpansionRight()
public int getTouchExpansionTop()
public int getLastHeightSpec()
public void setLastHeightSpec(int heightSpec)
public float getLastMeasuredHeight()
Component returned for the
height. This is used together with getLastHeightSpec() to implement
measure caching.public void setLastMeasuredHeight(float lastMeasuredHeight)
Component returned
for the height.public float getLastMeasuredWidth()
Component returned for the
width. This is used together with getLastWidthSpec() to implement
measure caching.public void setLastMeasuredWidth(float lastMeasuredWidth)
Component returned
for the width.public void setDiffNode(DiffNode diffNode)
public void setCachedMeasuresValid(boolean isValid)
public int getLastWidthSpec()
public boolean areCachedMeasuresValid()
public DiffNode getDiffNode()
public void setLastWidthSpec(int widthSpec)
public YogaDirection recursivelyResolveLayoutDirection()
public LithoRenderUnit getRenderUnit()
getRenderUnit in interface LayoutResultpublic LithoRenderUnit getContentRenderUnit(LayoutState layoutState)
public LithoRenderUnit getHostRenderUnit(LayoutState layoutState, boolean isRoot)
public LithoRenderUnit getBackgroundRenderUnit(LayoutState layoutState)
public LithoRenderUnit getForegroundRenderUnit(LayoutState layoutState)
public LithoRenderUnit getBorderRenderUnit(LayoutState layoutState)
public java.lang.Object getLayoutData()
getLayoutData in interface LayoutResultpublic void setLayoutData(java.lang.Object layoutData)
public int getChildrenCount()
getChildrenCount in interface LayoutResultpublic LithoLayoutResult getChildAt(int i)
getChildAt in interface LayoutResultpublic int getXForChildAtIndex(int index)
getXForChildAtIndex in interface LayoutResultpublic int getYForChildAtIndex(int index)
getYForChildAtIndex in interface LayoutResultpublic void addChild(LithoLayoutResult child)
public int getChildCount()
public LithoLayoutResult getParent()
public void setParent(LithoLayoutResult parent)
public YogaNode getYogaNode()
public static RenderState.LayoutContext getLayoutContextFromYogaNode(YogaNode yogaNode)
public static LithoLayoutResult getLayoutResultFromYogaNode(YogaNode yogaNode)
protected MeasureResult measureInternal(RenderState.LayoutContext<LithoRenderContext> context, int widthSpec, int heightSpec)
public static boolean willMountView(LithoLayoutResult result)
View. It returns true if
and only if the will mount a View. If it returns false then the
result will either mount a Drawable or it is NestedTreeHolderResult, which will
not mount anything.true iff the result will mount a view.