Search in sources :

Example 1 with BaseActivity

use of de.symeda.sormas.app.BaseActivity in project SORMAS-Project by hzi-braunschweig.

the class CaseEditTreatmentListFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((BaseActivity) getActivity()).showPreloader();
    adapter = new TreatmentListAdapter();
    TreatmentListViewModel model = ViewModelProviders.of(this).get(TreatmentListViewModel.class);
    model.initializeViewModel(getActivityRootData().getTherapy());
    model.getTreatments().observe(this, treatments -> {
        ((BaseActivity) getActivity()).hidePreloader();
        adapter.submitList(treatments);
        updateEmptyListHint(treatments);
    });
}
Also used : TreatmentListViewModel(de.symeda.sormas.app.therapy.list.TreatmentListViewModel) BaseActivity(de.symeda.sormas.app.BaseActivity) TreatmentListAdapter(de.symeda.sormas.app.therapy.list.TreatmentListAdapter)

Example 2 with BaseActivity

use of de.symeda.sormas.app.BaseActivity in project SORMAS-Project by hzi-braunschweig.

the class CaseEditEventListFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((BaseActivity) getActivity()).showPreloader();
    adapter = new EventListAdapter();
    EventListViewModel model = ViewModelProviders.of(this).get(EventListViewModel.class);
    model.initializeViewModel(getActivityRootData());
    model.getEvents().observe(this, events -> {
        ((CaseEditActivity) getActivity()).hidePreloader();
        adapter.submitList(events);
        updateEmptyListHint(events);
    });
}
Also used : BaseActivity(de.symeda.sormas.app.BaseActivity) EventListAdapter(de.symeda.sormas.app.event.list.EventListAdapter) EventListViewModel(de.symeda.sormas.app.event.list.EventListViewModel)

Example 3 with BaseActivity

use of de.symeda.sormas.app.BaseActivity in project SORMAS-Project by hzi-braunschweig.

the class CaseEditImmunizationListFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((BaseActivity) getActivity()).showPreloader();
    adapter = new ImmunizationListAdapter();
    ImmunizationListViewModel model = ViewModelProviders.of(this).get(ImmunizationListViewModel.class);
    model.initializeViewModel(getActivityRootData());
    model.getImmunizationList().observe(this, immunizations -> {
        ((CaseEditActivity) getActivity()).hidePreloader();
        adapter.submitList(immunizations);
        updateEmptyListHint(immunizations);
    });
}
Also used : ImmunizationListAdapter(de.symeda.sormas.app.immunization.list.ImmunizationListAdapter) ImmunizationListViewModel(de.symeda.sormas.app.immunization.list.ImmunizationListViewModel) BaseActivity(de.symeda.sormas.app.BaseActivity)

Example 4 with BaseActivity

use of de.symeda.sormas.app.BaseActivity in project SORMAS-Project by hzi-braunschweig.

the class CaseEditPrescriptionListFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((BaseActivity) getActivity()).showPreloader();
    adapter = new PrescriptionListAdapter();
    PrescriptionListViewModel model = ViewModelProviders.of(this).get(PrescriptionListViewModel.class);
    model.initializeViewModel(getActivityRootData().getTherapy());
    model.getPrescriptions().observe(this, prescriptions -> {
        ((BaseActivity) getActivity()).hidePreloader();
        adapter.submitList(prescriptions);
        updateEmptyListHint(prescriptions);
    });
}
Also used : PrescriptionListViewModel(de.symeda.sormas.app.therapy.list.PrescriptionListViewModel) BaseActivity(de.symeda.sormas.app.BaseActivity) PrescriptionListAdapter(de.symeda.sormas.app.therapy.list.PrescriptionListAdapter)

Example 5 with BaseActivity

use of de.symeda.sormas.app.BaseActivity in project SORMAS-Project by hzi-braunschweig.

the class CaseReadPrescriptionListFragment method onCreate.

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((BaseActivity) getActivity()).showPreloader();
    adapter = new PrescriptionListAdapter();
    PrescriptionListViewModel model = ViewModelProviders.of(this).get(PrescriptionListViewModel.class);
    model.initializeViewModel(getActivityRootData().getTherapy());
    model.getPrescriptions().observe(this, prescriptions -> {
        ((BaseActivity) getActivity()).hidePreloader();
        adapter.submitList(prescriptions);
        updateEmptyListHint(prescriptions);
    });
}
Also used : PrescriptionListViewModel(de.symeda.sormas.app.therapy.list.PrescriptionListViewModel) BaseActivity(de.symeda.sormas.app.BaseActivity) PrescriptionListAdapter(de.symeda.sormas.app.therapy.list.PrescriptionListAdapter)

Aggregations

BaseActivity (de.symeda.sormas.app.BaseActivity)12 ImmunizationListAdapter (de.symeda.sormas.app.immunization.list.ImmunizationListAdapter)3 ImmunizationListViewModel (de.symeda.sormas.app.immunization.list.ImmunizationListViewModel)3 ClinicalVisitListAdapter (de.symeda.sormas.app.clinicalcourse.list.ClinicalVisitListAdapter)2 ClinicalVisitListViewModel (de.symeda.sormas.app.clinicalcourse.list.ClinicalVisitListViewModel)2 PrescriptionListAdapter (de.symeda.sormas.app.therapy.list.PrescriptionListAdapter)2 PrescriptionListViewModel (de.symeda.sormas.app.therapy.list.PrescriptionListViewModel)2 TreatmentListAdapter (de.symeda.sormas.app.therapy.list.TreatmentListAdapter)2 TreatmentListViewModel (de.symeda.sormas.app.therapy.list.TreatmentListViewModel)2 EventListAdapter (de.symeda.sormas.app.event.list.EventListAdapter)1 EventListViewModel (de.symeda.sormas.app.event.list.EventListViewModel)1 VaccinationListAdapter (de.symeda.sormas.app.immunization.vaccination.VaccinationListAdapter)1 VaccinationListViewModel (de.symeda.sormas.app.immunization.vaccination.VaccinationListViewModel)1 SampleListAdapter (de.symeda.sormas.app.sample.list.SampleListAdapter)1 SampleListViewModel (de.symeda.sormas.app.sample.list.SampleListViewModel)1