public CalculateLayoutRunnable( @CalculateLayoutSource int source, @Nullable TreeProps treeProps, String attribution) { mSource = source; mTreeProps = treeProps; mAttribution = attribution; }
private final class CalculateLayoutRunnable extends ThreadTracingRunnable { private final @CalculateLayoutSource int mSource; @Nullable private final TreeProps mTreeProps; private final String mAttribution; public CalculateLayoutRunnable( @CalculateLayoutSource int source, @Nullable TreeProps treeProps, String attribution) { mSource = source; mTreeProps = treeProps; mAttribution = attribution; } @Override public void tracedRun(Throwable tracedThrowable) { calculateLayout(null, mSource, mAttribution, mTreeProps); } }
static LayoutState acquireLayoutState(ComponentContext context) { LayoutState state = ComponentsConfiguration.disablePools ? null : sLayoutStatePool.acquire(); if (state == null) { state = new LayoutState(); } state.init(context); return state; }
/** * This internal version of {@link #setRootAndSizeSpecInternal(Component, int, int, boolean, Size, * int, String, TreeProps)} wraps the provided root in a wrapper component first. Ensure to only * call this for entry calls to setRoot, i.e. non-recurring calls as you will otherwise continue * rewrapping the component. */ private void setRootAndSizeSpecAndWrapper( Component root, int widthSpec, int heightSpec, boolean isAsync, Size output, @CalculateLayoutSource int source, String extraAttribution, @Nullable TreeProps treeProps) { setRootAndSizeSpecInternal( wrapRootInErrorBoundary(root), widthSpec, heightSpec, isAsync, output, source, extraAttribution, treeProps); }
@Nullable LayoutState previousLayoutState, @Nullable TreeProps treeProps, @CalculateLayoutSource int source, @Nullable String extraAttribution) {
@Nullable LayoutState previousLayoutState, @Nullable TreeProps treeProps, @CalculateLayoutSource int source, @Nullable String extraAttribution) { final ComponentContext contextWithStateHandler;
boolean isAsync, @Nullable Size output, @CalculateLayoutSource int source, String extraAttribution, @Nullable TreeProps treeProps) {
@Before public void setup() { mContext = new ComponentContext(RuntimeEnvironment.application); mComponent = TestLayoutComponent.create(mContext) .build(); Whitebox.setInternalState(mComponent, "mId", COMPONENT_ID); mLayoutState = new LayoutState(); Whitebox.setInternalState(mLayoutState, "mWidth", WIDTH); Whitebox.setInternalState(mLayoutState, "mHeight", HEIGHT); Whitebox.setInternalState(mLayoutState, "mComponent", mComponent); }
@Before public void setup() { mContext = new ComponentContext(RuntimeEnvironment.application); mWidthSpec = SizeSpec.makeSizeSpec(39, SizeSpec.EXACTLY); mHeightSpec = SizeSpec.makeSizeSpec(41, SizeSpec.EXACTLY); mComponent = TestLayoutComponent.create(mContext) .build(); Whitebox.setInternalState(mComponent, "mId", COMPONENT_ID); mLayoutState = new LayoutState(); Whitebox.setInternalState(mLayoutState, "mComponent", mComponent); Whitebox.setInternalState(mLayoutState, "mWidthSpec", mWidthSpec); Whitebox.setInternalState(mLayoutState, "mHeightSpec", mHeightSpec); }
@CalculateLayoutSource int source, @Nullable String extraAttribution, @Nullable TreeProps treeProps) {