当前位置: 首页>>代码示例>>Java>>正文


Java LinearLayoutInfo类代码示例

本文整理汇总了Java中com.facebook.litho.widget.LinearLayoutInfo的典型用法代码示例。如果您正苦于以下问题:Java LinearLayoutInfo类的具体用法?Java LinearLayoutInfo怎么用?Java LinearLayoutInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LinearLayoutInfo类属于com.facebook.litho.widget包,在下文中一共展示了LinearLayoutInfo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import com.facebook.litho.widget.LinearLayoutInfo; //导入依赖的package包/类
public static void initialize(Context context) {
  final ComponentContext c = new ComponentContext(context);
  final RecyclerBinder glideRecyclerBinder = new RecyclerBinder(
      c,
      4.0f,
      new LinearLayoutInfo(c, OrientationHelper.VERTICAL, false));
  DataModel.populateBinderWithSampleDataForGlide(glideRecyclerBinder, c);

  demoModels = new LinkedHashMap<>();
  demoModels.put(
      "Lithography - Picasso",
      LithographyRootComponent.create(c)
          .recyclerBinder(glideRecyclerBinder)
          .build());
  demoModels.put("Playground", PlaygroundComponent.create(c).build());
}
 
开发者ID:charbgr,项目名称:litho-picasso,代码行数:17,代码来源:Demos.java

示例2: onCreate

import com.facebook.litho.widget.LinearLayoutInfo; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_repos);
    bindViews(this);
    componentContext = new ComponentContext(this);
    recyclerBinder = new RecyclerBinder(
            componentContext, 4.0f, new LinearLayoutInfo(this, OrientationHelper.VERTICAL, false));
    sRefresh.setOnRefreshListener(() -> store.dispatch(HomeAction.REFRESH));
}
 
开发者ID:dbof10,项目名称:redux-observable,代码行数:11,代码来源:HomeActivity.java

示例3: createComponent

import com.facebook.litho.widget.LinearLayoutInfo; //导入依赖的package包/类
@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();
}
 
开发者ID:pavlospt,项目名称:litho-glide,代码行数:15,代码来源:GlideArtist.java

示例4: onCreateLayout

import com.facebook.litho.widget.LinearLayoutInfo; //导入依赖的package包/类
@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();
}
 
开发者ID:pavlospt,项目名称:litho-glide,代码行数:13,代码来源:DemoListComponentSpec.java

示例5: initialize

import com.facebook.litho.widget.LinearLayoutInfo; //导入依赖的package包/类
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());
}
 
开发者ID:pavlospt,项目名称:litho-glide,代码行数:12,代码来源:Demos.java

示例6: createComponent

import com.facebook.litho.widget.LinearLayoutInfo; //导入依赖的package包/类
@Override
public Component createComponent(ComponentContext c) {
  final RecyclerBinder imageRecyclerBinder =
      new RecyclerBinder(c, 4.0f, new LinearLayoutInfo(c, OrientationHelper.HORIZONTAL, false));

  for (String image : images) {
    ComponentInfo.Builder imageComponentInfoBuilder = ComponentInfo.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();
}
 
开发者ID:charbgr,项目名称:litho-picasso,代码行数:16,代码来源:PicassoArtist.java

示例7: onCreateLayout

import com.facebook.litho.widget.LinearLayoutInfo; //导入依赖的package包/类
@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();
}
 
开发者ID:charbgr,项目名称:litho-picasso,代码行数:16,代码来源:DemoListComponentSpec.java

示例8: renderContent

import com.facebook.litho.widget.LinearLayoutInfo; //导入依赖的package包/类
private void renderContent(List<HomeSection> sections) {
    sRefresh.setRefreshing(false);
    ComponentInfo.Builder componentInfoBuilder;

    for (HomeSection section : sections) {

        componentInfoBuilder = ComponentInfo.create();

        if (section instanceof SingleBannerSection) {
            componentInfoBuilder
                    .component(
                            SingleBannerComponent
                                    .create(componentContext)
                                    .payload((SingleBannerSection) section)
                                    .key(((SingleBannerSection) section).title())
                                    .build()
                    );
        } else if (section instanceof TripleBannerSection) {

            componentInfoBuilder
                    .component(
                            TripleBannersComponent.create(componentContext)
                                    .payload((TripleBannerSection) section)
                                    .key(((TripleBannerSection) section).title())
                                    .build()
                    );
        } else if (section instanceof ProductSlideSection) {

            final RecyclerBinder productSlideBinder = new RecyclerBinder(componentContext, 4.0f,
                    new LinearLayoutInfo(this, OrientationHelper.HORIZONTAL, false));

            for (Product product : ((ProductSlideSection) section).products()) {
                componentInfoBuilder = ComponentInfo.create();
                componentInfoBuilder
                        .component(
                                ProductComponent.create(componentContext)
                                        .product(product)
                                        .key(product.id())
                                        .build()
                        );
                productSlideBinder.insertItemAt(productSlideBinder.getItemCount(), componentInfoBuilder.build());
            }

            componentInfoBuilder = ComponentInfo.create();
            componentInfoBuilder
                    .component(
                            ProductSlideComponent.create(componentContext)
                                    .title(((ProductSlideSection) section).title())
                                    .recyclerBinder(productSlideBinder)
                                    .key(((ProductSlideSection) section).title())
                                    .build()
                    );
        }
        recyclerBinder.insertItemAt(recyclerBinder.getItemCount(), componentInfoBuilder.build());
    }

    ltView.setComponent(
            HomeListComponent
                    .create(componentContext)
                    .binder(recyclerBinder)
                    .build()
    );
}
 
开发者ID:dbof10,项目名称:redux-observable,代码行数:64,代码来源:HomeActivity.java


注:本文中的com.facebook.litho.widget.LinearLayoutInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。