Search in sources :

Example 1 with BugzyAlertDialog

use of in.bugzy.ui.common.BugzyAlertDialog in project bugzy by cpunq.

the class CaseEditActivity method getCaseErrorAlertDialog.

private AlertDialog getCaseErrorAlertDialog(String message) {
    BugzyAlertDialog dialog = getDialogInstance();
    dialog.setTitle("Error");
    dialog.setMessage("Failed to refresh the Case details.\nDescription: " + message);
    dialog.setPositiveButtonText("Retry");
    dialog.setNegativeButtonText("Cancel");
    dialog.setOnPositiveButtonClickListener(view -> {
        mCaseEditViewModel.setParams(mMode, mCaseId);
    });
    dialog.setOnNegativeButtonClickListener(view -> {
        if (mCaseErrorAlertDialog != null && mCaseErrorAlertDialog.isShowing()) {
            mCaseErrorAlertDialog.dismiss();
        }
    });
    dialog.setCancelable(false);
    return dialog;
}
Also used : BugzyAlertDialog(in.bugzy.ui.common.BugzyAlertDialog)

Example 2 with BugzyAlertDialog

use of in.bugzy.ui.common.BugzyAlertDialog in project bugzy by cpunq.

the class CaseEditActivity method getCloseDialog.

private AlertDialog getCloseDialog() {
    BugzyAlertDialog dialog = getDialogInstance();
    dialog.setTitle("Are you sure?");
    dialog.setMessage("Your case hasn\'t been submitted yet, are you sure you want to leave?");
    dialog.setPositiveButtonText("Yes");
    dialog.setNegativeButtonText("No");
    dialog.setOnPositiveButtonClickListener(view -> {
        if (mCloseDialog != null && mCloseDialog.isShowing()) {
            mCloseDialog.dismiss();
        }
        finish();
    });
    dialog.setOnNegativeButtonClickListener(view -> {
        if (mCloseDialog != null && mCloseDialog.isShowing()) {
            mCloseDialog.dismiss();
        }
    });
    return dialog;
}
Also used : BugzyAlertDialog(in.bugzy.ui.common.BugzyAlertDialog)

Example 3 with BugzyAlertDialog

use of in.bugzy.ui.common.BugzyAlertDialog in project bugzy by cpunq.

the class HomeActivity method getLogoutDialog.

private AlertDialog getLogoutDialog() {
    BugzyAlertDialog dialog = getDialogInstance();
    dialog.setTitle("Are you sure?");
    dialog.setMessage("This will remove all your cached data.");
    dialog.setPositiveButtonText("Logout");
    dialog.setNegativeButtonText("Cancel");
    dialog.setOnPositiveButtonClickListener(view -> {
        mHomeViewModel.logout();
    });
    dialog.setOnNegativeButtonClickListener(view -> {
        if (mLogoutDialog != null && mLogoutDialog.isShowing()) {
            mLogoutDialog.dismiss();
        }
    });
    dialog.setCancelable(false);
    return dialog;
}
Also used : BugzyAlertDialog(in.bugzy.ui.common.BugzyAlertDialog)

Aggregations

BugzyAlertDialog (in.bugzy.ui.common.BugzyAlertDialog)3