Search in sources :

Example 1 with PatientListDataAdapter

use of com.jexapps.bloodhub.m_UI.PatientListDataAdapter in project BloodHub by kazijehangir.

the class OrgPatientListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_org_patient_list, container, false);
    db = FirebaseDatabase.getInstance().getReference().child("patients");
    patients = new ArrayList<Patient>();
    keys = new ArrayList<String>();
    fetchData();
    mRecyclerView = (RecyclerView) rootView.findViewById(R.id.org_patient_list_recycler_view);
    mRecyclerView.setHasFixedSize(true);
    mLayoutManager = new LinearLayoutManager(getActivity());
    mRecyclerView.setLayoutManager(mLayoutManager);
    mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    mRecyclerView.addItemDecoration(new RecycleMarginDecoration(getActivity()));
    mAdapter = new PatientListDataAdapter(patients, keys, getContext());
    mRecyclerView.setAdapter(mAdapter);
    return rootView;
}
Also used : Patient(com.jexapps.bloodhub.m_Model.Patient) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) PatientListDataAdapter(com.jexapps.bloodhub.m_UI.PatientListDataAdapter)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 Patient (com.jexapps.bloodhub.m_Model.Patient)1 PatientListDataAdapter (com.jexapps.bloodhub.m_UI.PatientListDataAdapter)1