@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 top) { return Row.create(c) .heightDip(200) .alignItems(top ? YogaAlign.FLEX_START : YogaAlign.FLEX_END) .child( Row.create(c) .heightDip(40) .flexGrow(1) .backgroundColor(Color.parseColor("#ee1111")) .transitionKey("red") .build()) .child( Row.create(c) .heightDip(40) .flexGrow(1) .backgroundColor(Color.parseColor("#1111ee")) .transitionKey("blue") .build()) .child( Row.create(c) .heightDip(40) .flexGrow(1) .backgroundColor(Color.parseColor("#11ee11")) .transitionKey("green") .build()) .clickHandler(UpDownBlocksComponent.onClick(c)) .build(); }
.widthDip(40) .backgroundColor(Color.parseColor("#ee1111")) .transitionKey("red") .build()) .child( .widthDip(40) .backgroundColor(Color.parseColor("#1111ee")) .transitionKey("blue") .build()) .child( .widthDip(40) .backgroundColor(Color.parseColor("#11ee11")) .transitionKey("green") .build()) .child( .widthDip(40) .backgroundColor(Color.BLACK) .transitionKey("black") .build()) .clickHandler(LeftRightBlocksComponent.onClick(c))
.child( Row.create(c) .transitionKey("cont_comment") .widthPercent(33.3f) .alignItems(YogaAlign.CENTER) .child( Row.create(c) .transitionKey("cont_share") .alignItems(YogaAlign.CENTER) .clickHandler(StoryFooterComponent.onClick(c))
.child( Row.create(c) .transitionKey(TRANSITION_KEY_CONTAINER_4_1) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .heightDip(60) .child( Row.create(c) .transitionKey(TRANSITION_KEY_CONTAINER_4_2) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .heightDip(60)
.widthDip(40) .backgroundColor(Color.parseColor("#ee1111")) .transitionKey(TRANSITION_KEY_RED) .build())) .child( .widthDip(40) .backgroundColor(Color.parseColor("#1111ee")) .transitionKey(TRANSITION_KEY_BLUE) .build())) .child( .widthDip(40) .backgroundColor(Color.parseColor("#11ee11")) .transitionKey(TRANSITION_KEY_GREEN) .build())) .clickHandler(OneByOneLeftRightBlocksComponent.onClick(c))
private static Component affectedChildren(ComponentContext c, boolean flag1) { return Row.create(c) .transitionKey(TRANSITION_KEY_CONTAINER_1) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .heightDip(60 + 2 * 8) .widthDip((3 * 60) * (flag1 ? 0.5f : 1) + 4 * 8) .paddingDip(YogaEdge.ALL, 8) .backgroundColor(Color.YELLOW) .child( Column.create(c) .transitionKey(TRANSITION_KEY_CHILD_1_1) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .flex(1) .backgroundColor(Color.RED)) .child( Column.create(c) .transitionKey(TRANSITION_KEY_CHILD_1_2) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .flex(1) .backgroundColor(Color.RED) .marginDip(YogaEdge.HORIZONTAL, 8)) .child( Column.create(c) .flex(1) .transitionKey(TRANSITION_KEY_CHILD_1_3) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .backgroundColor(Color.RED)) .clickHandler(BoundsAnimationComponent.onFirstComponentClick(c)) .build(); }
private static Component affectedSiblings(ComponentContext c, boolean flag2) { return Row.create(c) .transitionKey(TRANSITION_KEY_CONTAINER_2) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .heightDip(60 + 2 * 8) .widthDip(3 * 60 + 3 * 8) .paddingDip(YogaEdge.ALL, 8) .backgroundColor(Color.LTGRAY) .child( Column.create(c) .transitionKey(TRANSITION_KEY_CHILD_2_1) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .flex(1) .backgroundColor(Color.RED)) .child( Column.create(c) .transitionKey(TRANSITION_KEY_CHILD_2_2) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .flex(flag2 ? 1 : 2) .backgroundColor(Color.YELLOW) .marginDip(YogaEdge.LEFT, 8)) .clickHandler(BoundsAnimationComponent.onSecondComponentClick(c)) .build(); }
private static Component affectedParent(ComponentContext c, boolean flag3) { return Row.create(c) .justifyContent(YogaJustify.CENTER) .child( Row.create(c) .transitionKey(TRANSITION_KEY_CONTAINER_3) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .heightDip(60 + 2 * 8) .paddingDip(YogaEdge.ALL, 8) .backgroundColor(Color.LTGRAY) .child( Column.create(c) .transitionKey(TRANSITION_KEY_CHILD_3_1) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .widthDip(60 * (flag3 ? 1 : 2)) .backgroundColor(Color.YELLOW)) .clickHandler(BoundsAnimationComponent.onThirdComponentClick(c))) .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(ComponentContext c) { return Row.create(c) .child(Row.create(c).transitionKey("test").transitionKeyType(Transition.TransitionKeyType.GLOBAL)) .child(Row.create(c).transitionKey("test2").transitionKeyType(Transition.TransitionKeyType.GLOBAL)) .build(); } };
@Override protected Component onCreateLayout(ComponentContext c) { return Row.create(c) .child(Row.create(c).transitionKey("test").transitionKeyType(Transition.TransitionKeyType.GLOBAL)) .child(Row.create(c).transitionKey("test").transitionKeyType(Transition.TransitionKeyType.GLOBAL)) .build(); } };
@Override protected Component onCreateLayout(ComponentContext c) { return Row.create(c) .child(Row.create(c).transitionKey("test")) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .child(Row.create(c).transitionKey("test2")) .transitionKeyType(Transition.TransitionKeyType.GLOBAL) .build(); }