Example #1
0
        private void BtnAddPhoneNumberOnClick(object sender, EventArgs e)
        {
            try
            {
                FullNumber = TxtNumber2.Text;

                if (Regex.IsMatch(FullNumber, "^\\+?(\\d[\\d-. ]+)?(\\([\\d-. ]+\\))?[\\d-. ]+\\d$") &&
                    FullNumber.Length >= 10)
                {
                    if (!string.IsNullOrEmpty(FullNumber))
                    {
                        Intent intent = new Intent(ActivityContext, typeof(VerificationCodeActivity));
                        intent.PutExtra("Number", FullNumber);
                        ActivityContext.StartActivityForResult(intent, 125);

                        AddPhoneNumberWindow.Hide();
                        AddPhoneNumberWindow.Dismiss();
                    }
                }
                else
                {
                    var dialog = new MaterialDialog.Builder(ActivityContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light);
                    dialog.Title(Resource.String.Lbl_Warning);
                    dialog.Content(FullNumber + " " + ActivityContext.GetText(Resource.String.Lbl_ISNotValidNumber));
                    dialog.PositiveText(ActivityContext.GetText(Resource.String.Lbl_Ok)).OnPositive((materialDialog, action) => { dialog.Dispose(); });
                    dialog.AlwaysCallSingleChoiceCallback();
                    dialog.Build().Show();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Example #2
0
 private void BtnSkipAddPhoneNumberOnClick(object sender, EventArgs e)
 {
     try
     {
         AddPhoneNumberWindow.Hide();
         AddPhoneNumberWindow.Dismiss();
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }