Search in sources :

Example 1 with DialogClassificationRulesLayoutBinding

use of de.symeda.sormas.app.databinding.DialogClassificationRulesLayoutBinding 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();
    });
}
Also used : DialogClassificationRulesLayoutBinding(de.symeda.sormas.app.databinding.DialogClassificationRulesLayoutBinding) InfoDialog(de.symeda.sormas.app.component.dialog.InfoDialog) WebView(android.webkit.WebView) Case(de.symeda.sormas.app.backend.caze.Case)

Aggregations

WebView (android.webkit.WebView)1 Case (de.symeda.sormas.app.backend.caze.Case)1 InfoDialog (de.symeda.sormas.app.component.dialog.InfoDialog)1 DialogClassificationRulesLayoutBinding (de.symeda.sormas.app.databinding.DialogClassificationRulesLayoutBinding)1