com.facebook.litho.widget.LinearLayoutInfo Java Examples
The following examples show how to use
com.facebook.litho.widget.LinearLayoutInfo.
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: ExamplesActivityComponentSpec.java From litho with Apache License 2.0 | 6 votes |
@OnCreateLayout static Component onCreateLayout(ComponentContext c) { final RecyclerBinder recyclerBinder = new RecyclerBinder.Builder() .layoutInfo(new LinearLayoutInfo(c, OrientationHelper.VERTICAL, false)) .build(c); Populator.with(recyclerBinder, c) .addRow("Layout Specs", ExamplesActivityComponent.onClickLayoutSpecs(c)) .addRow("Text Widget", ExamplesActivityComponent.onClickTextWidget(c)) .addRow("Containers", ExamplesActivityComponent.onClickContainers(c)) .addRow("Props", ExamplesActivityComponent.onClickProps(c)) .addRow("Layout Props", ExamplesActivityComponent.onClickLayoutProps(c)) .addRow("Click Events", ExamplesActivityComponent.onClickClickEvents(c)) .addRow("State", ExamplesActivityComponent.onClickState(c)) .addRow("Recycler Binder", ExamplesActivityComponent.onClickRecyclerBinder(c)); return Recycler.create(c).binder(recyclerBinder).build(); }
Example #2
Source File: LearningRecyclerBinderComponentSpec.java From litho with Apache License 2.0 | 5 votes |
@OnCreateLayout static Component onCreateLayout(ComponentContext c) { final RecyclerBinder recyclerBinder = new RecyclerBinder.Builder() .layoutInfo(new LinearLayoutInfo(c, OrientationHelper.VERTICAL, false)) .build(c); for (int i = 0; i < 32; i++) { recyclerBinder.insertItemAt( i, LearningPropsComponent.create(c).text1("Item: " + i).text2("Item: " + i).build()); } return Recycler.create(c).binder(recyclerBinder).build(); }
Example #3
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 #4
Source File: DemoListComponentSpec.java From litho-glide with MIT License | 5 votes |
@OnCreateLayout static Component 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) .build(); }
Example #5
Source File: Demos.java From litho-glide with MIT License | 5 votes |
public static void initialize(Context context) { final ComponentContext c = new ComponentContext(context); final RecyclerBinder glideRecyclerBinder = new RecyclerBinder.Builder().layoutInfo( new LinearLayoutInfo(c, OrientationHelper.VERTICAL, false)).build(c); DataModel.populateBinderWithSampleDataForGlide(glideRecyclerBinder, c); demoModels = new LinkedHashMap<>(); demoModels.put("Lithography - Glide", LithographyRootComponent.create(c).recyclerBinder(glideRecyclerBinder).build()); demoModels.put("Playground", PlaygroundComponent.create(c).build()); }
Example #6
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 #7
Source File: DemoListComponentSpec.java From litho-picasso with MIT License | 5 votes |
@OnCreateLayout static Component 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) .build(); }
Example #8
Source File: Demos.java From litho-picasso with MIT License | 5 votes |
public static void initialize(Context context) { final ComponentContext c = new ComponentContext(context); final RecyclerBinder glideRecyclerBinder = new RecyclerBinder.Builder().layoutInfo( new LinearLayoutInfo(c, OrientationHelper.VERTICAL, false)).build(c); DataModel.populateBinderWithSampleDataForPicasso(glideRecyclerBinder, c); demoModels = new LinkedHashMap<>(); demoModels.put( "Lithography - Picasso", LithographyRootComponent.create(c) .recyclerBinder(glideRecyclerBinder) .build()); demoModels.put("Playground", PlaygroundComponent.create(c).build()); }
Example #9
Source File: ListRecyclerConfiguration.java From litho with Apache License 2.0 | 4 votes |
@Override public LinearLayoutInfo createLinearLayoutInfo( Context c, int orientation, boolean reverseLayout) { return new LinearLayoutInfo(c, orientation, reverseLayout); }
Example #10
Source File: LinearLayoutInfoFactory.java From litho with Apache License 2.0 | 2 votes |
/** * @return a new {@link LinearLayoutInfo} that will be used to compute the layouts of the children * of the {@link ListRecyclerConfiguration}. */ LinearLayoutInfo createLinearLayoutInfo(Context context, int orientation, boolean reverseLayout);