use of com.github.florent37.materialviewpager.sample.TestRecyclerViewAdapter in project MaterialViewPager by florent37.
the class RecyclerViewFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
final List<Object> items = new ArrayList<>();
for (int i = 0; i < ITEM_COUNT; ++i) {
items.add(new Object());
}
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
//Use this now
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
mRecyclerView.setAdapter(new TestRecyclerViewAdapter(items));
}
use of com.github.florent37.materialviewpager.sample.TestRecyclerViewAdapter in project easy by MehdiBenmesa.
the class RecyclerViewFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
final List<Object> items = new ArrayList<>();
for (int i = 0; i < ITEM_COUNT; ++i) {
items.add(new Object());
}
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
//Use this now
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
mRecyclerView.setAdapter(new TestRecyclerViewAdapter(items));
}
Aggregations