use of de.symeda.sormas.app.component.dialog.InfoDialog in project SORMAS-Project by hzi-braunschweig.
the class CaseEditFragment method setUpButtonListeners.
private void setUpButtonListeners(FragmentCaseEditLayoutBinding contentBinding) {
contentBinding.referCaseFromPoe.setOnClickListener(e -> {
final CaseEditActivity activity = (CaseEditActivity) CaseEditFragment.this.getActivity();
activity.saveData(caze -> {
final Case caseClone = (Case) caze.clone();
final ReferCaseFromPoeDialog referCaseFromPoeDialog = new ReferCaseFromPoeDialog(BaseActivity.getActiveActivity(), caze);
referCaseFromPoeDialog.setPositiveCallback(() -> {
record = caseClone;
requestLayoutRebind();
});
referCaseFromPoeDialog.show();
});
});
contentBinding.showClassificationRules.setOnClickListener(v -> {
final InfoDialog classificationDialog = new InfoDialog(CaseEditFragment.this.getContext(), R.layout.dialog_classification_rules_layout, null);
WebView classificationView = ((DialogClassificationRulesLayoutBinding) classificationDialog.getBinding()).content;
classificationView.loadData(DiseaseClassificationAppHelper.buildDiseaseClassificationHtml(record.getDisease()), "text/html", "utf-8");
classificationDialog.show();
});
}
use of de.symeda.sormas.app.component.dialog.InfoDialog in project SORMAS-Project by hzi-braunschweig.
the class EpidemiologicalDataReadFragment method setUpControlListeners.
private void setUpControlListeners() {
onExposureItemClickListener = (v, item) -> {
InfoDialog infoDialog = new InfoDialog(getContext(), R.layout.dialog_exposure_read_layout, item, boundView -> FieldVisibilityAndAccessHelper.setFieldVisibilitiesAndAccesses(ExposureDto.class, (ViewGroup) boundView, new FieldVisibilityCheckers(), getFieldAccessCheckers()));
final DialogExposureReadLayoutBinding exposureBinding = (DialogExposureReadLayoutBinding) infoDialog.getBinding();
if (((Exposure) item).getMeansOfTransport() == MeansOfTransport.PLANE) {
exposureBinding.exposureConnectionNumber.setCaption(I18nProperties.getCaption(Captions.exposureFlightNumber));
}
final FacilityType facilityType = ((Exposure) item).getLocation().getFacilityType();
exposureBinding.exposureWorkEnvironment.setVisibility(facilityType == null || FacilityTypeGroup.WORKING_PLACE != facilityType.getFacilityTypeGroup() ? View.GONE : View.VISIBLE);
FieldVisibilityAndAccessHelper.setFieldVisibilitiesAndAccesses(ExposureDto.class, (ViewGroup) infoDialog.getBinding().getRoot(), FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(getActivityRootData())), UiFieldAccessCheckers.forSensitiveData(((PseudonymizableAdo) getActivityRootData()).isPseudonymized()));
infoDialog.show();
};
onActivityAsCaseItemClickListener = (v, item) -> {
InfoDialog infoDialog = new InfoDialog(getContext(), R.layout.dialog_activity_as_case_read_layout, item, boundView -> FieldVisibilityAndAccessHelper.setFieldVisibilitiesAndAccesses(ActivityAsCaseDto.class, (ViewGroup) boundView, getFieldVisibilityCheckers(), getFieldAccessCheckers()));
final DialogActivityAsCaseReadLayoutBinding activityAsCaseBinding = (DialogActivityAsCaseReadLayoutBinding) infoDialog.getBinding();
if (((ActivityAsCase) item).getMeansOfTransport() == MeansOfTransport.PLANE) {
activityAsCaseBinding.activityAsCaseConnectionNumber.setCaption(I18nProperties.getCaption(Captions.activityAsCaseFlightNumber));
}
if (CountryHelper.isCountry(ConfigProvider.getServerCountryCode(), CountryHelper.COUNTRY_CODE_GERMANY)) {
activityAsCaseBinding.activityAsCaseTypeOfPlace.setCaption(I18nProperties.getCaption(Captions.ActivityAsCase_typeOfPlaceIfSG));
}
final FacilityType facilityType = ((ActivityAsCase) item).getLocation().getFacilityType();
activityAsCaseBinding.activityAsCaseWorkEnvironment.setVisibility(facilityType == null || FacilityTypeGroup.WORKING_PLACE != facilityType.getFacilityTypeGroup() ? View.GONE : View.VISIBLE);
FieldVisibilityAndAccessHelper.setFieldVisibilitiesAndAccesses(ActivityAsCaseDto.class, (ViewGroup) infoDialog.getBinding().getRoot(), FieldVisibilityCheckers.withDisease(getDiseaseOfCaseOrContact(getActivityRootData())).andWithCountry(ConfigProvider.getServerCountryCode()), UiFieldAccessCheckers.forSensitiveData(((PseudonymizableAdo) getActivityRootData()).isPseudonymized()));
infoDialog.show();
};
}
use of de.symeda.sormas.app.component.dialog.InfoDialog in project SORMAS-Project by hzi-braunschweig.
the class PersonReadFragment method setUpControlListeners.
private void setUpControlListeners() {
onAddressItemClickListener = (v, item) -> {
InfoDialog infoDialog = new InfoDialog(getContext(), R.layout.dialog_location_read_layout, item, bindedView -> setFieldAccesses(LocationDto.class, bindedView));
infoDialog.show();
};
onPersonContactDetailItemClickListener = (v, item) -> {
InfoDialog infoDialog = new InfoDialog(getContext(), R.layout.dialog_person_contact_detail_read_layout, item, bindedView -> setFieldAccesses(PersonContactDetailDto.class, bindedView));
infoDialog.show();
};
}
use of de.symeda.sormas.app.component.dialog.InfoDialog in project SORMAS-Project by hzi-braunschweig.
the class BaseActivity method onOptionsItemSelected.
public boolean onOptionsItemSelected(MenuItem item) {
if (!isSubActivity() && menuDrawerToggle.onOptionsItemSelected(item)) {
return true;
}
switch(item.getItemId()) {
case android.R.id.home:
if (finishInsteadOfUpNav) {
finish();
} else {
NavigationHelper.navigateUpFrom(this);
}
return true;
case R.id.action_sync:
synchronizeChangedData();
return true;
case R.id.action_new:
goToNewView();
return true;
case R.id.action_readAll:
// TODO
return true;
case R.id.action_help:
StringBuilder helpStringBuilder = new StringBuilder();
extendHelpString(helpStringBuilder, (ViewGroup) this.findViewById(R.id.main_content));
InfoDialog infoDialog = new InfoDialog(getContext(), R.layout.dialog_screen_help_layout, Html.fromHtml(helpStringBuilder.toString()));
infoDialog.show();
return true;
}
return super.onOptionsItemSelected(item);
}
Aggregations