use of de.symeda.sormas.app.databinding.DialogExposureReadLayoutBinding 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();
};
}
Aggregations