use of com.nightonke.saver.model.CoCoinRecord in project CoCoin by Nightonke.
the class TagViewFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setHasFixedSize(true);
if (position == 0) {
for (CoCoinRecord coCoinRecord : RecordManager.RECORDS) {
list.add(coCoinRecord);
}
}
if (position == 1) {
for (CoCoinRecord coCoinRecord : RecordManager.RECORDS) {
list.add(coCoinRecord);
}
} else {
for (CoCoinRecord coCoinRecord : RecordManager.RECORDS) {
if (coCoinRecord.getTag() == RecordManager.TAGS.get(position).getId()) {
list.add(coCoinRecord);
}
}
}
mAdapter = new RecyclerViewMaterialAdapter(new TagViewRecyclerViewAdapter(list, mContext, position));
mRecyclerView.setAdapter(mAdapter);
MaterialViewPagerHelper.registerRecyclerView(getActivity(), mRecyclerView, null);
}
Aggregations