本文整理汇总了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);
}
示例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);
}
示例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)));
}
示例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)));
}
示例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)));
}