@OnCreateLayout static Component onCreateLayout(ComponentContext c, @Prop final Decade decade) { return Row.create(c) .alignItems(YogaAlign.CENTER) .paddingDip(YogaEdge.ALL, 16) .child( Row.create(c) .heightPx(1) .backgroundColor(0xFFAAAAAA) .flex(1)) .child( Text.create(c) .text(String.valueOf(decade.year)) .textSizeDip(14) .textColor(0xFFAAAAAA) .marginDip(YogaEdge.HORIZONTAL, 10) .flex(0)) .child( Row.create(c) .heightPx(1) .backgroundColor(0xFFAAAAAA) .flex(1)) .backgroundColor(0xFFFAFAFA) .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(); } });
@OnCreateLayout static Component onCreateLayout( ComponentContext c, @Prop(resType = ResType.DIMEN_SIZE) int radius, @Prop(resType = ResType.COLOR) int color) { final int dim = 2 * radius; return Row.create(c) .heightPx(dim) .widthPx(dim) .background(buildRoundedRect(radius, color)) .build(); }
@Override protected Component onCreateLayout(final ComponentContext c) { return create(c) .child(Row.create(c).child(innerComponent).widthPx(100).heightPx(100)) .build(); } };
@Override protected Component onCreateLayout(final ComponentContext c) { return create(c) .child(Row.create(c).child(innerComponent).widthPx(100).heightPx(100)) .build(); } };