Search in sources :

Example 1 with MyAppointmentOrgDataAdapter

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

the class AppointmentsOrgFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = (View) inflater.inflate(R.layout.fragment_appointments_org, 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 MyAppointmentOrgDataAdapter(appointments, keys);
    mRecyclerView.setAdapter(mAdapter);
    return rootView;
}
Also used : Appointment(com.jexapps.bloodhub.m_Model.Appointment) MyAppointmentOrgDataAdapter(com.jexapps.bloodhub.m_UI.MyAppointmentOrgDataAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

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 TextView (android.widget.TextView)1 Appointment (com.jexapps.bloodhub.m_Model.Appointment)1 MyAppointmentOrgDataAdapter (com.jexapps.bloodhub.m_UI.MyAppointmentOrgDataAdapter)1