Exemplo n.º 1
0
        private void ShowAlert()
        {
            var alert = new SweetAlertDialog(Activity, SweetAlertDialog.WarningType);

            alert.SetTitleText("Feedback confirmation");
            alert.SetContentText("Do you wish to send this feedback?");
            alert.SetConfirmText("Yes");
            alert.SetCancelText("No");
            alert.SetCancelable(false);
            alert.SetCanceledOnTouchOutside(false);
            alert.SetConfirmClickListener(new SweetConfirmClick(swAlert =>
            {
                swAlert.SetTitleText("Success");
                swAlert.SetContentText("Your feedback has been submitted successfully!");
                swAlert.SetConfirmText("OK");
                swAlert.ShowCancelButton(false);
                swAlert.SetConfirmClickListener(new SweetConfirmClick(swAlert2 =>
                {
                    swAlert2.Dismiss();
                    base.Dismiss();
                }));
                swAlert.ChangeAlertType(SweetAlertDialog.SuccessType);
                swAlert.Show();
            }));
            alert.Show();
        }
 public static void ShowProgressDialog()
 {
     loadingDialog = new SweetAlertDialog(_context, SweetAlertDialog.ProgressType);
     loadingDialog.SetCancelable(false);
     loadingDialog.SetTitleText("Loading");
     loadingDialog.ShowCancelButton(false);
     loadingDialog.Show();
 }
 public static void ShowErrorDialog(string errorMessage)
 {
     errorDialog = new SweetAlertDialog(_context, SweetAlertDialog.ErrorType);
     errorDialog.SetCancelable(false);
     errorDialog.SetTitleText("Oops...");
     errorDialog.SetContentText(errorMessage);
     errorDialog.SetConfirmText("OK");
     errorDialog.ShowCancelButton(false);
     errorDialog.SetConfirmClickListener(new SweetConfirmClick(d =>
     {
         errorDialog.DismissWithAnimation();
         errorDialog = null;
     }));
     errorDialog.Show();
 }
 private void ShowEmailExistsDialog()
 {
     infoAlertDialog = new SweetAlertDialog(Activity, SweetAlertDialog.ErrorType);
     infoAlertDialog.SetCancelable(false);
     infoAlertDialog.SetTitleText("Sign up error");
     infoAlertDialog.SetContentText("The email account provided is associated with an existing account. Would you like to sign in instead?");
     infoAlertDialog.SetCancelText("No");
     infoAlertDialog.SetConfirmText("Yes");
     infoAlertDialog.SetConfirmClickListener(new SweetConfirmClick(sweet =>
     {
         ClearTextFields();
         OnEmailExistsListener?.Invoke(this, new EventArgs());
         infoAlertDialog.DismissWithAnimation();
         infoAlertDialog = null;
     }));
     infoAlertDialog.Show();
 }