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;
}
Aggregations