public class LayoutState extends java.lang.Object implements IncrementalMountExtensionInput, VisibilityExtensionInput, TransitionsExtensionInput, EndToEndTestingExtension.EndToEndTestingExtensionInput, PotentiallyPartialResult
LayoutState
is to hold the output of layout calculation. This includes
mountable outputs and visibility outputs. A centerpiece of the class is #collectResults(ComponentContext, LithoLayoutResult, LithoNode, LayoutState, RenderTreeNode,
DiffNode, DebugHierarchy.Node)
which prepares the before-mentioned outputs based on the provided
LithoNode
for later use in MountState
.
This needs to be accessible to statically mock the class in tests.
Modifier and Type | Class and Description |
---|---|
static interface |
LayoutState.CalculateLayoutSource |
public static boolean isFromSyncLayout(int source)
public boolean isPartialResult()
PotentiallyPartialResult
TreeFuture
is partial.isPartialResult
in interface PotentiallyPartialResult
public int getMountableOutputCount()
getMountableOutputCount
in interface EndToEndTestingExtension.EndToEndTestingExtensionInput
getMountableOutputCount
in interface MountDelegateInput
getMountableOutputCount
in interface TransitionsExtensionInput
public int getIncrementalMountOutputCount()
getIncrementalMountOutputCount
in interface IncrementalMountExtensionInput
public RenderTreeNode getMountableOutputAt(int index)
MountDelegateInput
RenderTreeNode
given its absolute position.getMountableOutputAt
in interface EndToEndTestingExtension.EndToEndTestingExtensionInput
getMountableOutputAt
in interface MountDelegateInput
getMountableOutputAt
in interface TransitionsExtensionInput
public IncrementalMountOutput getIncrementalMountOutputForId(long id)
getIncrementalMountOutputForId
in interface IncrementalMountExtensionInput
public java.util.Collection<IncrementalMountOutput> getIncrementalMountOutputs()
IncrementalMountExtensionInput
getIncrementalMountOutputs
in interface IncrementalMountExtensionInput
public AnimatableItem getAnimatableRootItem()
getAnimatableRootItem
in interface TransitionsExtensionInput
public AnimatableItem getAnimatableItem(long id)
getAnimatableItem
in interface TransitionsExtensionInput
public java.util.ArrayList<IncrementalMountOutput> getOutputsOrderedByTopBounds()
getOutputsOrderedByTopBounds
in interface IncrementalMountExtensionInput
public java.util.ArrayList<IncrementalMountOutput> getOutputsOrderedByBottomBounds()
getOutputsOrderedByBottomBounds
in interface IncrementalMountExtensionInput
public java.util.List<VisibilityOutput> getVisibilityOutputs()
VisibilityExtensionInput
getVisibilityOutputs
in interface VisibilityExtensionInput
public int getTestOutputCount()
getTestOutputCount
in interface EndToEndTestingExtension.EndToEndTestingExtensionInput
public com.facebook.litho.TestOutput getTestOutputAt(int index)
getTestOutputAt
in interface EndToEndTestingExtension.EndToEndTestingExtensionInput
public DiffNode getDiffTree()
public int getTreeId()
getTreeId
in interface TransitionsExtensionInput
public int getComponentTreeId()
ComponentTree
that generated this LayoutState
public ComponentContext getComponentContext()
public LithoNode getLayoutRoot()
public LithoLayoutResult getRootLayoutResult()
public int getPositionForId(long layoutOutputId)
MountDelegateInput
RenderUnit
given its id.getPositionForId
in interface EndToEndTestingExtension.EndToEndTestingExtensionInput
getPositionForId
in interface MountDelegateInput
LayoutOutput
with id layoutOutputId in the LayoutState
list of outputs or -1 if no LayoutOutput
with that id exists in the
LayoutState
public boolean renderUnitWithIdHostsRenderTrees(long id)
renderUnitWithIdHostsRenderTrees
in interface IncrementalMountExtensionInput
renderUnitWithIdHostsRenderTrees
in interface TransitionsExtensionInput
public java.util.Set<java.lang.Long> getRenderUnitIdsWhichHostRenderTrees()
VisibilityExtensionInput
RenderUnit
s which host RenderTreeHost
getRenderUnitIdsWhichHostRenderTrees
in interface VisibilityExtensionInput
public java.util.List<Transition> getTransitions()
getTransitions
in interface TransitionsExtensionInput
public java.util.Map<TransitionId,OutputUnitsAffinityGroup<AnimatableItem>> getTransitionIdMapping()
getTransitionIdMapping
in interface TransitionsExtensionInput
public OutputUnitsAffinityGroup<AnimatableItem> getAnimatableItemForTransitionId(TransitionId transitionId)
getAnimatableItemForTransitionId
in interface TransitionsExtensionInput
public java.util.List<ScopedComponentInfo> getScopedComponentInfosNeedingPreviousRenderData()
public void setInitialRootBoundsForAnimation(Transition.RootBoundsTransition rootWidth, Transition.RootBoundsTransition rootHeight)
setInitialRootBoundsForAnimation
in interface TransitionsExtensionInput
public java.util.List<Transition> getMountTimeTransitions()
getMountTimeTransitions
in interface TransitionsExtensionInput
public boolean isIncrementalMountEnabled()
isIncrementalMountEnabled
in interface TransitionsExtensionInput
public Systracer getTracer()
getTracer
in interface TransitionsExtensionInput
public TransitionId getRootTransitionId()
getRootTransitionId
in interface TransitionsExtensionInput
public boolean needsToRerunTransitions()
needsToRerunTransitions
in interface TransitionsExtensionInput
public void setNeedsToRerunTransitions(boolean needsToRerunTransitions)
setNeedsToRerunTransitions
in interface TransitionsExtensionInput
public boolean isProcessingVisibilityOutputsEnabled()
isProcessingVisibilityOutputsEnabled
in interface VisibilityExtensionInput
public void setShouldProcessVisibilityOutputs(boolean value)
public java.lang.String getRootName()
getRootName
in interface TransitionsExtensionInput
@Deprecated public static LayoutState createTestInstance(ComponentContext c)