use of com.jexapps.bloodhub.m_UI.MyAppointmentDataAdapter in project BloodHub by kazijehangir.
the class AppointmentsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = (View) inflater.inflate(R.layout.fragment_appointments, container, false);
db = FirebaseDatabase.getInstance().getReference().child("appointments");
appointments = new ArrayList<Appointment>();
keys = new ArrayList<String>();
fetchData();
numAppointments = (TextView) rootView.findViewById(R.id.num_appointments);
mRecyclerView = (RecyclerView) rootView.findViewById(R.id.appointment_list_recycler_view);
mRecyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
mRecyclerView.addItemDecoration(new RecycleMarginDecoration(getActivity()));
mAdapter = new MyAppointmentDataAdapter(appointments, keys);
mRecyclerView.setAdapter(mAdapter);
return rootView;
}
Aggregations