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 ComponentLayout
public int getY()
getY
in interface ComponentLayout
public int getWidth()
getWidth
in interface ComponentLayout
getWidth
in interface LayoutResult
public int getHeight()
getHeight
in interface ComponentLayout
getHeight
in interface LayoutResult
public int getPaddingTop()
getPaddingTop
in interface ComponentLayout
getPaddingTop
in interface LayoutResult
public int getPaddingRight()
getPaddingRight
in interface ComponentLayout
getPaddingRight
in interface LayoutResult
public int getPaddingBottom()
getPaddingBottom
in interface ComponentLayout
getPaddingBottom
in interface LayoutResult
public int getPaddingLeft()
getPaddingLeft
in interface ComponentLayout
getPaddingLeft
in interface LayoutResult
public int getWidthSpec()
getWidthSpec
in interface LayoutResult
public int getHeightSpec()
getHeightSpec
in interface LayoutResult
public boolean isPaddingSet()
isPaddingSet
in interface ComponentLayout
public Drawable getBackground()
getBackground
in interface ComponentLayout
public YogaDirection getResolvedLayoutDirection()
getResolvedLayoutDirection
in interface ComponentLayout
public 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 LayoutResult
public 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 LayoutResult
public void setLayoutData(java.lang.Object layoutData)
public int getChildrenCount()
getChildrenCount
in interface LayoutResult
public LithoLayoutResult getChildAt(int i)
getChildAt
in interface LayoutResult
public int getXForChildAtIndex(int index)
getXForChildAtIndex
in interface LayoutResult
public int getYForChildAtIndex(int index)
getYForChildAtIndex
in interface LayoutResult
public 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.