@OnCreateLayout static ComponentLayout onCreateLayout(ComponentContext c, @Prop String title, @Prop RecyclerBinder recyclerBinder) { return Column.create(c) .child( Text.create(c) .text(title) .glyphWarming(true) .textSizeSp(16) .withLayout() .paddingDip(TOP, 8) .paddingDip(BOTTOM, 4) .heightDip(44) ) .paddingDip(LEFT, 8) .paddingDip(RIGHT, 8) .child( Recycler.create(c) .hasFixedSize(true) .binder(recyclerBinder) ) .build(); }
@OnCreateLayout static ComponentLayout onCreateLayout(ComponentContext c, @Prop RecyclerBinder binder) { return Recycler.create(c) .binder(binder) .withLayout().flexShrink(0) .testKey(MAIN_SCREEN) .build(); }
@OnCreateLayout static ComponentLayout onCreateLayout(ComponentContext c, @Prop final RecyclerBinder recyclerBinder) { return Recycler.create(c) .binder(recyclerBinder) .flexShrink(0) .paddingDip(YogaEdge.TOP, 8) .testKey(MAIN_SCREEN) .buildWithLayout(); }
@OnCreateLayout static ComponentLayout onCreateLayout(ComponentContext c) { final RecyclerBinder recyclerBinder = new RecyclerBinder.Builder().layoutInfo( new LinearLayoutInfo(c, OrientationHelper.VERTICAL, false)).build(c); Demos.addAllToBinder(recyclerBinder, c); return Recycler.create(c) .binder(recyclerBinder) .flexShrink(0) .testKey(MAIN_SCREEN) .buildWithLayout(); }
@OnCreateLayout static ComponentLayout onCreateLayout( ComponentContext c, @Prop final RecyclerBinder recyclerBinder) { return Recycler.create(c) .binder(recyclerBinder) .withLayout().flexShrink(0) .paddingDip(YogaEdge.TOP, 8) .testKey(MAIN_SCREEN) .build(); }
@OnCreateLayout static ComponentLayout onCreateLayout(ComponentContext c) { final RecyclerBinder recyclerBinder = new RecyclerBinder( c, 4.0f, new LinearLayoutInfo(c, OrientationHelper.VERTICAL, false)); Demos.addAllToBinder(recyclerBinder, c); return Recycler.create(c) .binder(recyclerBinder) .withLayout().flexShrink(0) .testKey(MAIN_SCREEN) .build(); }
private static ComponentLayout.Builder getRecyclerComponent(ComponentContext c, RecyclerBinder binder) { return Recycler.create(c).binder(binder).withLayout().flexShrink(0).aspectRatio(2); }