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


Java RendererAdapter类代码示例

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


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

示例1: configRecyclerView

import com.github.ppamorim.recyclerrenderers.adapter.RendererAdapter; //导入依赖的package包/类
public void configRecyclerView() {

    ArrayList<Renderable> texts = new ArrayList<>();
    for (int i = 0; i < 100; i++) {
      texts.add(new Item(new StringBuilder("test ").append(i).toString()));
    }

    recyclerView.setHasFixedSize(true);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(new RendererAdapter(
        texts,
        new RendererBuilder(new Factory()),
        LayoutInflater.from(this)));
    recyclerView.setScrollViewCallbacks(onObservableScrollViewCallbacks);
  }
 
开发者ID:ppamorim,项目名称:Dragger,代码行数:19,代码来源:ListActivity.java

示例2: configRecyclerView

import com.github.ppamorim.recyclerrenderers.adapter.RendererAdapter; //导入依赖的package包/类
public void configRecyclerView() {

    ArrayList<Renderable> texts = new ArrayList<>();
    for (int i = 0; i < 100; i++) {
      texts.add(new Item(new StringBuilder("test ").append(i).toString()));
    }

    recyclerView.setHasFixedSize(true);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(
        new RendererAdapter(
            texts,
            new RendererBuilder(new Factory()),
            LayoutInflater.from(this)));
    recyclerView.setScrollViewCallbacks(observableScrollViewCallbacks);
  }
 
开发者ID:ppamorim,项目名称:Dragger,代码行数:20,代码来源:ActivityListActivity.java

示例3: onPostCreate

import com.github.ppamorim.recyclerrenderers.adapter.RendererAdapter; //导入依赖的package包/类
@Override protected void onPostCreate(Bundle savedInstanceState) {
  super.onPostCreate(savedInstanceState);
  String[] items = getResources().getStringArray(R.array.home);
  ArrayList<Renderable> renderables = new ArrayList<>(items.length);
  for (String text : items) {
    renderables.add(new Home(text));
  }
  observableRecyclerView.setHasFixedSize(true);
  observableRecyclerView.setItemAnimator(new DefaultItemAnimator());
  GridLayoutManager layoutManager = new GridLayoutManager(this, 2);
  layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
  observableRecyclerView.setLayoutManager(layoutManager);
  observableRecyclerView.setAdapter(
      new RendererAdapter(renderables,
          new RendererBuilder(new Factory()),
          LayoutInflater.from(this)));
}
 
开发者ID:ppamorim,项目名称:Dragger,代码行数:18,代码来源:BaseActivity.java

示例4: configRecyclerView

import com.github.ppamorim.recyclerrenderers.adapter.RendererAdapter; //导入依赖的package包/类
public static void configRecyclerView(final Context context, RecyclerView recyclerView) {
  recyclerView.setHasFixedSize(true);
  recyclerView.setItemAnimator(new DefaultItemAnimator());
  GridLayoutManager layoutManager = new GridLayoutManager(context, 2);
  layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
  recyclerView.addItemDecoration(new MarginDecoration(context));
  recyclerView.setLayoutManager(layoutManager);
  recyclerView.setAdapter(new RendererAdapter<Console>(generateConsoles(),
      new RendererBuilder(new Factory()), LayoutInflater.from(context)));
}
 
开发者ID:ppamorim,项目名称:RecyclerRenderers,代码行数:11,代码来源:ViewUtil.java

示例5: configRecyclerView

import com.github.ppamorim.recyclerrenderers.adapter.RendererAdapter; //导入依赖的package包/类
public static void configRecyclerView(Context context, RecyclerView recyclerView) {
  recyclerView.setHasFixedSize(true);
  recyclerView.setItemAnimator(new DefaultItemAnimator());
  LinearLayoutManager layoutManager = new LinearLayoutManager(context);
  recyclerView.addItemDecoration(new MarginDecoration(context));
  recyclerView.setLayoutManager(layoutManager);
  recyclerView.setAdapter(new RendererAdapter<Vapor>(VaporProvider.generateVapors(context),
      new RendererBuilder(new VaporFactory()), LayoutInflater.from(context)));
}
 
开发者ID:ppamorim,项目名称:PrismView,代码行数:10,代码来源:ViewUtil.java


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