Java Code Examples for com.facebook.litho.widget.ComponentRenderInfo#create()
The following examples show how to use
com.facebook.litho.widget.ComponentRenderInfo#create() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataModel.java From litho-glide with MIT License | 5 votes |
public static void populateBinderWithSampleDataForGlide(RecyclerBinder recyclerBinder, ComponentContext c) { final Datum[] dataModels = SampleDataForGlide(); for (Datum datum : dataModels) { ComponentRenderInfo.Builder componentInfoBuilder = ComponentRenderInfo.create(); componentInfoBuilder.component(datum.createComponent(c)).isSticky(datum instanceof Decade); recyclerBinder.insertItemAt(recyclerBinder.getItemCount(), componentInfoBuilder.build()); } }
Example 2
Source File: GlideArtist.java From litho-glide with MIT License | 5 votes |
@Override public Component createComponent(ComponentContext c) { final RecyclerBinder imageRecyclerBinder = new RecyclerBinder.Builder().layoutInfo( new LinearLayoutInfo(c, OrientationHelper.HORIZONTAL, false)).build(c); for (String image : images) { ComponentRenderInfo.Builder imageComponentInfoBuilder = ComponentRenderInfo.create(); imageComponentInfoBuilder.component( GlideSingleImageComponent.create(c).image(image).aspectRatio(2).build()); imageRecyclerBinder.insertItemAt(imageRecyclerBinder.getItemCount(), imageComponentInfoBuilder.build()); } return FeedItemCard.create(c).artist(this).binder(imageRecyclerBinder).build(); }
Example 3
Source File: Demos.java From litho-glide with MIT License | 5 votes |
public static void addAllToBinder(RecyclerBinder recyclerBinder, ComponentContext c) { for (String name : demoModels.keySet()) { ComponentRenderInfo.Builder componentInfoBuilder = ComponentRenderInfo.create(); componentInfoBuilder.component(DemoListItemComponent.create(c).name(name).build()); recyclerBinder.insertItemAt(recyclerBinder.getItemCount(), componentInfoBuilder.build()); } }
Example 4
Source File: DataModel.java From litho-picasso with MIT License | 5 votes |
public static void populateBinderWithSampleDataForPicasso(RecyclerBinder recyclerBinder, ComponentContext c) { final Datum[] dataModels = SampleData(); for (Datum datum : dataModels) { ComponentRenderInfo.Builder componentInfoBuilder = ComponentRenderInfo.create(); componentInfoBuilder.component(datum.createComponent(c)).isSticky(datum instanceof Decade); recyclerBinder.insertItemAt(recyclerBinder.getItemCount(), componentInfoBuilder.build()); } }
Example 5
Source File: PicassoArtist.java From litho-picasso with MIT License | 5 votes |
@Override public Component createComponent(ComponentContext c) { final RecyclerBinder imageRecyclerBinder = new RecyclerBinder.Builder().layoutInfo( new LinearLayoutInfo(c, OrientationHelper.HORIZONTAL, false)).build(c); for (String image : images) { ComponentRenderInfo.Builder imageComponentInfoBuilder = ComponentRenderInfo.create(); imageComponentInfoBuilder.component( PicassoSingleImageComponent.create(c).image(image).fit(true).build()); imageRecyclerBinder.insertItemAt(imageRecyclerBinder.getItemCount(), imageComponentInfoBuilder.build()); } return FeedItemCard.create(c).artist(this).binder(imageRecyclerBinder).build(); }
Example 6
Source File: Demos.java From litho-picasso with MIT License | 5 votes |
public static void addAllToBinder(RecyclerBinder recyclerBinder, ComponentContext c) { for (String name : demoModels.keySet()) { ComponentRenderInfo.Builder componentInfoBuilder = ComponentRenderInfo.create(); componentInfoBuilder.component( DemoListItemComponent.create(c) .name(name) .build()); recyclerBinder.insertItemAt(recyclerBinder.getItemCount(), componentInfoBuilder.build()); } }