@OnCreateLayout static Component onCreateLayout(ComponentContext c, @State boolean left) { return Column.create(c) .alignItems(left ? YogaAlign.FLEX_START : YogaAlign.FLEX_END) .child( Row.create(c) .heightDip(40) .widthDip(40) .backgroundColor(Color.parseColor("#ee1111")) .transitionKey("red") .build()) .child( Row.create(c) .heightDip(40) .widthDip(40) .backgroundColor(Color.parseColor("#1111ee")) .transitionKey("blue") .build()) .child( Row.create(c) .heightDip(40) .widthDip(40) .backgroundColor(Color.parseColor("#11ee11")) .transitionKey("green") .build()) .clickHandler(LeftRightBlocksSequenceComponent.onClick(c)) .build(); }
@OnCreateLayout static Component onCreateLayout(ComponentContext c, @State boolean left) { return Column.create(c) .alignItems(left ? YogaAlign.FLEX_START : YogaAlign.FLEX_END) .child( Row.create(c)
.child( Column.create(c) .alignItems(redLeft ? YogaAlign.FLEX_START : YogaAlign.FLEX_END) .child( Row.create(c) .child( Column.create(c) .alignItems(blueLeft ? YogaAlign.FLEX_START : YogaAlign.FLEX_END) .child( Row.create(c) .child( Column.create(c) .alignItems(greenLeft ? YogaAlign.FLEX_START : YogaAlign.FLEX_END) .child( Row.create(c)
@OnCreateLayout static Component onCreateLayout(ComponentContext c) { return Column.create(c) .alignItems(CENTER) .child( Text.create(c)
@OnCreateLayout static Component onCreateLayout(ComponentContext c) { return Column.create(c) .alignItems(CENTER) .child( Text.create(c)
final String title = (selectedPage + 1) + "/" + PAGES_COUNT; return Column.create(c) .alignItems(YogaAlign.CENTER) .justifyContent(YogaJustify.CENTER) .child(Text.create(c).textSizeDip(20).text(title))
@OnCreateLayout static Component onCreateLayout( ComponentContext c, @State boolean autoBoundsTransitionEnabled, @State boolean flag1, @State boolean flag2, @State boolean flag3, @State boolean flag4) { return Column.create(c) .backgroundColor(Color.WHITE) .alignItems(YogaAlign.CENTER) .paddingDip(YogaEdge.VERTICAL, 8) .child( Text.create(c) .text("ABT " + (autoBoundsTransitionEnabled ? "enabled" : "disabled")) .textSizeSp(20) .textStyle(Typeface.BOLD) .clickHandler(BoundsAnimationComponent.onABTClick(c))) .child( Text.create(c).marginDip(YogaEdge.VERTICAL, 8).text("Affected Children").textSizeSp(20)) .child(affectedChildren(c, flag1)) .child( Text.create(c).marginDip(YogaEdge.VERTICAL, 8).text("Affected Siblings").textSizeSp(20)) .child(affectedSiblings(c, flag2)) .child( Text.create(c).marginDip(YogaEdge.VERTICAL, 8).text("Affected Parent").textSizeSp(20)) .child(affectedParent(c, flag3)) .child(altogether(c, flag4)) .build(); }
@Override protected Component onCreateLayout(ComponentContext c) { return Column.create(c) .alignItems(FLEX_END) .justifyContent(YogaJustify.FLEX_END) .child( Column.create(c) .widthPx(100) .heightPx(100) .paddingPx(ALL, 20) .wrapInView() .child( Column.create(c) .widthPx(60) .heightPx(60) .wrapInView() .child(create(c).widthPx(20).heightPx(20).marginPx(ALL, 20)))) .build(); } },
@Override protected Component onCreateLayout(ComponentContext c) { return Column.create(c) .justifyContent(YogaJustify.CENTER) .alignItems(YogaAlign.CENTER) .child( Row.create(c) .widthPx(20) .heightPx(20) .transitionKey("row") .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .justifyContent(YogaJustify.CENTER) .alignItems(YogaAlign.CENTER) .child(create(c).widthPx(10).heightPx(10))) .build(); } });
@Override protected Component onCreateLayout(final ComponentContext c) { return create(c) .alignItems(FLEX_START) .widthPx(100) .heightPx(100) .child( TestSizeDependentComponent.create(c) .widthPercent(50) .heightPercent(50) .backgroundColor(0xFFFF0000)) .build(); } };
@Override protected Component onCreateLayout(final ComponentContext c) { return create(c) .alignItems(FLEX_START) .widthPx(50) .heightPx(50) .child( TestSizeDependentComponent.create(c) .setFixSizes(true) .paddingPercent(ALL, 10) .backgroundColor(0xFFFF0000)) .build(); } };
@Override protected Component onCreateLayout(ComponentContext c) { return create(c) .alignItems(FLEX_START) .child(Wrapper.create(c).delegate(mComponent).heightPx(50)) .build(); } }
@Override protected Component onCreateLayout(final ComponentContext c) { return create(c) .alignItems(FLEX_START) .child( TestSizeDependentComponent.create(c) .setFixSizes(true) .widthPercent(50) .heightPercent(50) .backgroundColor(0xFFFF0000)) .build(); } };