Search in sources :

Example 1 with EventParticipantSection

use of de.symeda.sormas.app.event.eventparticipant.EventParticipantSection in project SORMAS-Project by hzi-braunschweig.

the class EventParticipantEditActivity method buildEditFragment.

@Override
protected BaseEditFragment buildEditFragment(PageMenuItem menuItem, EventParticipant activityRootData) {
    EventParticipantSection section = EventParticipantSection.fromOrdinal(menuItem.getPosition());
    BaseEditFragment fragment;
    switch(section) {
        case EVENT_PARTICIPANT_INFO:
            fragment = EventParticipantEditFragment.newInstance(activityRootData);
            break;
        case PERSON_INFO:
            fragment = PersonEditFragment.newInstance(activityRootData);
            break;
        case IMMUNIZATIONS:
            fragment = EventParticipantEditImmunizationListFragment.newInstance(activityRootData);
            break;
        case VACCINATIONS:
            fragment = EventParticipantEditVaccinationListFragment.newInstance(activityRootData);
            break;
        default:
            throw new IndexOutOfBoundsException(DataHelper.toStringNullable(section));
    }
    return fragment;
}
Also used : EventParticipantSection(de.symeda.sormas.app.event.eventparticipant.EventParticipantSection) BaseEditFragment(de.symeda.sormas.app.BaseEditFragment)

Example 2 with EventParticipantSection

use of de.symeda.sormas.app.event.eventparticipant.EventParticipantSection in project SORMAS-Project by hzi-braunschweig.

the class EventParticipantReadActivity method buildReadFragment.

@Override
protected BaseReadFragment buildReadFragment(PageMenuItem menuItem, EventParticipant activityRootData) {
    EventParticipantSection section = EventParticipantSection.fromOrdinal(menuItem.getPosition());
    BaseReadFragment fragment;
    switch(section) {
        case EVENT_PARTICIPANT_INFO:
            fragment = EventParticipantReadFragment.newInstance(activityRootData);
            break;
        case PERSON_INFO:
            fragment = PersonReadFragment.newInstance(activityRootData);
            break;
        case IMMUNIZATIONS:
            fragment = EventParticipantReadImmunizationListFragment.newInstance(activityRootData);
            break;
        case VACCINATIONS:
            fragment = EventParticipantReadVaccinationListFragment.newInstance(activityRootData);
            break;
        default:
            throw new IndexOutOfBoundsException(DataHelper.toStringNullable(section));
    }
    return fragment;
}
Also used : EventParticipantSection(de.symeda.sormas.app.event.eventparticipant.EventParticipantSection) BaseReadFragment(de.symeda.sormas.app.BaseReadFragment)

Example 3 with EventParticipantSection

use of de.symeda.sormas.app.event.eventparticipant.EventParticipantSection in project SORMAS-Project by hzi-braunschweig.

the class EventParticipantReadActivity method goToEditView.

@Override
public void goToEditView() {
    EventParticipantSection section = EventParticipantSection.fromOrdinal(getActivePage().getPosition());
    EventParticipantEditActivity.startActivity(this, getRootUuid(), eventUuid, section);
}
Also used : EventParticipantSection(de.symeda.sormas.app.event.eventparticipant.EventParticipantSection)

Aggregations

EventParticipantSection (de.symeda.sormas.app.event.eventparticipant.EventParticipantSection)3 BaseEditFragment (de.symeda.sormas.app.BaseEditFragment)1 BaseReadFragment (de.symeda.sormas.app.BaseReadFragment)1