public class TestComponentTree extends ComponentTree
ComponentTree
for testing purposes. Leverages test classes to create component layouts
and exposes additional information useful for testing.Modifier and Type | Class and Description |
---|---|
static class |
TestComponentTree.Builder |
ComponentTree.MeasureListener, ComponentTree.NewLayoutStateReadyListener
INVALID_ID, mId
Modifier and Type | Method and Description |
---|---|
void |
attach() |
protected com.facebook.litho.LayoutState |
calculateLayoutState(Object lock,
ComponentContext context,
Component root,
int widthSpec,
int heightSpec,
boolean diffingEnabled,
com.facebook.litho.LayoutState previousLayoutState,
TreeProps treeProps,
int source,
String extraAttribution) |
static TestComponentTree.Builder |
create(ComponentContext context,
Component root) |
List<Component> |
getSubComponents() |
void |
measure(int widthSpec,
int heightSpec,
int[] measureOutput,
boolean forceLayout) |
void |
mountComponent(Rect currentVisibleArea,
boolean processVisibilityOutputs) |
void |
setLithoView(LithoView view)
Set a new LithoView to this ComponentTree checking that they have the same context and
clear the ComponentTree reference from the previous LithoView if any.
|
acquireStateHandler, checkWorkingRangeAndDispatch, consumePreviousRenderState, create, generateComponentTreeId, getBackgroundLayoutState, getContext, getLithoView, getNewLayoutStateReadyListener, hasCompatibleLayout, hasMounted, isIncrementalMountEnabled, isIncrementalMountOnPreDraw, isReleased, release, setNewLayoutStateReadyListener, setRoot, setRootAndSizeSpec, setRootAndSizeSpec, setRootAndSizeSpec, setRootAndSizeSpecAsync, setRootAndSizeSpecAsync, setRootAsync, setSizeSpec, setSizeSpec, setSizeSpecAsync, updateLayoutThreadHandler
public static TestComponentTree.Builder create(ComponentContext context, Component root)
protected com.facebook.litho.LayoutState calculateLayoutState(Object lock, ComponentContext context, Component root, int widthSpec, int heightSpec, boolean diffingEnabled, com.facebook.litho.LayoutState previousLayoutState, TreeProps treeProps, int source, String extraAttribution)
calculateLayoutState
in class ComponentTree
public void setLithoView(LithoView view)
ComponentTree
public void mountComponent(Rect currentVisibleArea, boolean processVisibilityOutputs)
public void measure(int widthSpec, int heightSpec, int[] measureOutput, boolean forceLayout)
public void attach()