Search in sources :

Example 1 with EnrollmentFailureDialogFragment

use of org.edx.mobile.view.dialog.EnrollmentFailureDialogFragment in project edx-app-android by edx.

the class BaseWebViewFindCoursesActivity method showEnrollErrorMessage.

private void showEnrollErrorMessage(final String courseId, final boolean emailOptIn) {
    if (isActivityStarted()) {
        Map<String, String> dialogMap = new HashMap<String, String>();
        dialogMap.put("message_1", getString(R.string.enrollment_failure));
        dialogMap.put("yes_button", getString(R.string.try_again));
        dialogMap.put("no_button", getString(R.string.label_cancel));
        EnrollmentFailureDialogFragment failureDialogFragment = EnrollmentFailureDialogFragment.newInstance(dialogMap, new IDialogCallback() {

            @Override
            public void onPositiveClicked() {
                onClickEnroll(courseId, emailOptIn);
            }

            @Override
            public void onNegativeClicked() {
            }
        });
        failureDialogFragment.setStyle(DialogFragment.STYLE_NO_TITLE, 0);
        failureDialogFragment.show(getSupportFragmentManager(), "dialog");
        failureDialogFragment.setCancelable(false);
    }
}
Also used : HashMap(java.util.HashMap) EnrollmentFailureDialogFragment(org.edx.mobile.view.dialog.EnrollmentFailureDialogFragment) IDialogCallback(org.edx.mobile.view.dialog.IDialogCallback)

Aggregations

HashMap (java.util.HashMap)1 EnrollmentFailureDialogFragment (org.edx.mobile.view.dialog.EnrollmentFailureDialogFragment)1 IDialogCallback (org.edx.mobile.view.dialog.IDialogCallback)1