public static void calculateLayoutState( ComponentContext c, Component component, int widthSizeSpec, int heightSizeSpec) { LayoutState.calculate( c, component, -1, widthSizeSpec, heightSizeSpec, LayoutState.CalculateLayoutSource.TEST); }
static LayoutState calculate( ComponentContext c, Component component, int componentTreeId, int widthSpec, int heightSpec, @CalculateLayoutSource int source) { return calculate( c, component, componentTreeId, widthSpec, heightSpec, false /* shouldGenerateDiffTree */, null /* previousDiffTreeRoot */, source, null, false /* isPersistenceEnabled */); }
private static LayoutState calculateLayoutState( ComponentContext context, Component component, int widthSpec, int heightSpec) { return calculate( context, component, -1, widthSpec, heightSpec, false, null, LayoutState.CalculateLayoutSource.TEST, null, false); }
private static LayoutState calculateLayoutStateWithDiffing( ComponentContext context, Component component, int widthSpec, int heightSpec, LayoutState previousLayoutState) { return calculate( context, component, -1, widthSpec, heightSpec, true, previousLayoutState, LayoutState.CalculateLayoutSource.TEST, null, false); }
private static LayoutState calculateLayoutState( final Context context, final Component component, final int componentTreeId, final int widthSpec, final int heightSpec) { return LayoutState.calculate( new ComponentContext(context), component, componentTreeId, widthSpec, heightSpec, LayoutState.CalculateLayoutSource.TEST); } }
private LayoutState calculateLayoutState( final Context context, final Component component, final int componentTreeId, final int widthSpec, final int heightSpec) { return LayoutState.calculate( new ComponentContext(context), component, componentTreeId, widthSpec, heightSpec, LayoutState.CalculateLayoutSource.TEST); } }
private static LayoutState calculateLayoutState( Context context, Component component, int componentTreeId, int widthSpec, int heightSpec) { return LayoutState.calculate( new ComponentContext(context), component, componentTreeId, widthSpec, heightSpec, LayoutState.CalculateLayoutSource.TEST); }
private static LayoutState calculateLayoutState( Context context, Component component, int componentTreeId, int widthSpec, int heightSpec) { return LayoutState.calculate( new ComponentContext(context), component, componentTreeId, widthSpec, heightSpec, false /* shouldGenerateDiffTree */, null /* previousDiffTreeRoot */, LayoutState.CalculateLayoutSource.TEST, null, false); } }
return LayoutState.calculate( contextWithStateHandler, root,
@Test public void testNestedEventHandlerInput() { LayoutState.calculate( new ComponentContext(RuntimeEnvironment.application), mRootComponent, -1, mUnspecifiedSizeSpec, mUnspecifiedSizeSpec, LayoutState.CalculateLayoutSource.TEST); } }
@Test public void testGetTransitionKeyMapping() { ComponentContext c = new ComponentContext(application); LayoutState layoutState = LayoutState.calculate( c, mHasUniqueTransitionKeys, ComponentTree.generateComponentTreeId(), View.MeasureSpec.makeMeasureSpec(100, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(100, View.MeasureSpec.EXACTLY), LayoutState.CalculateLayoutSource.TEST); layoutState.getTransitionIdMapping(); }
@Override protected LayoutState calculateLayoutState( ComponentContext context, Component root, int widthSpec, int heightSpec, boolean diffingEnabled, @Nullable LayoutState previousLayoutState, TreeProps treeProps, @LayoutState.CalculateLayoutSource int source, String extraAttribution) { return LayoutState.calculate( new TestComponentContext( ComponentContext.withComponentTree(new TestComponentContext(context), this), new StateHandler()), root, mId, widthSpec, heightSpec, diffingEnabled, previousLayoutState, source, extraAttribution, false); }
@Test public void testCollectsWrappingTransitions() { ComponentContext c = new ComponentContext(application); LayoutState layoutState = LayoutState.calculate( c, mWrappingContentWithTransition, ComponentTree.generateComponentTreeId(), View.MeasureSpec.makeMeasureSpec(100, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(100, View.MeasureSpec.EXACTLY), LayoutState.CalculateLayoutSource.TEST); assertThat(layoutState.getTransitions()).hasSize(2); } }
LayoutState.calculate( new ComponentContext(RuntimeEnvironment.application), input,
@Test public void testThrowIfSameTransitionKeyAppearsMultipleTimes() { mExpectedException.expect(RuntimeException.class); mExpectedException.expectMessage( "The transitionId 'TransitionId{\"test\", GLOBAL}' is defined multiple times in the same layout."); ComponentContext c = new ComponentContext(application); LayoutState layoutState = LayoutState.calculate( c, mHasNonUniqueTransitionKeys, ComponentTree.generateComponentTreeId(), View.MeasureSpec.makeMeasureSpec(100, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(100, View.MeasureSpec.EXACTLY), LayoutState.CalculateLayoutSource.TEST); assertThat(layoutState.getTransitionIdMapping()).isNotNull(); } }
calculate( new ComponentContext(application), component,