Search in sources :

Example 6 with CoCoinRecord

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);
}
Also used : TagViewRecyclerViewAdapter(com.nightonke.saver.adapter.TagViewRecyclerViewAdapter) RecyclerView(android.support.v7.widget.RecyclerView) RecyclerViewMaterialAdapter(com.github.florent37.materialviewpager.adapter.RecyclerViewMaterialAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) CoCoinRecord(com.nightonke.saver.model.CoCoinRecord)

Aggregations

CoCoinRecord (com.nightonke.saver.model.CoCoinRecord)6 RecyclerView (android.support.v7.widget.RecyclerView)4 View (android.view.View)4 TextView (android.widget.TextView)4 ImageView (android.widget.ImageView)3 FragmentActivity (android.support.v4.app.FragmentActivity)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 Snackbar (com.nispok.snackbar.Snackbar)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 Cursor (android.database.Cursor)1 NinePatchDrawable (android.graphics.drawable.NinePatchDrawable)1 ActionBar (android.support.v7.app.ActionBar)1 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 Window (android.view.Window)1 AdapterView (android.widget.AdapterView)1 LinearLayout (android.widget.LinearLayout)1 InjectView (butterknife.InjectView)1