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();
        }
Example #2
0
 private void ShowLoading()
 {
     loaderDialog = new SweetAlertDialog(this, SweetAlertDialog.ProgressType);
     loaderDialog.SetTitleText("Finding the nearest Oyadieyie...");
     loaderDialog.ShowCancelButton(false);
     loaderDialog.Show();
 }
 public static void ShowLoader()
 {
     loaderDialog = new SweetAlertDialog(_context, SweetAlertDialog.ProgressType);
     loaderDialog.SetTitleText("Loading");
     loaderDialog.ShowCancelButton(false);
     loaderDialog.Show();
 }
 private void ShowLoading()
 {
     loaderDialog = new SweetAlertDialog(this, SweetAlertDialog.ProgressType);
     loaderDialog.SetTitleText("Loading");
     loaderDialog.ShowCancelButton(false);
     loaderDialog.Show();
 }
Example #5
0
        private void ShowSuccess()
        {
            var sweetprogress = new SweetAlertDialog(this, SweetAlertDialog.SuccessType);

            sweetprogress.SetTitleText("Success");
            sweetprogress.SetConfirmText("OK");
            sweetprogress.SetConfirmClickListener(null);
            sweetprogress.ShowCancelButton(false);
            sweetprogress.Show();
        }
        public static void ShowSuccess()
        {
            var successDialog = new SweetAlertDialog(_context, SweetAlertDialog.SuccessType);

            successDialog.SetTitleText("Success");
            successDialog.SetConfirmText("OK");
            successDialog.ShowCancelButton(false);
            successDialog.SetConfirmClickListener(null);
            successDialog.Show();
        }
 public static void ShowInfo(string info)
 {
     infoDialog = new SweetAlertDialog(_context, SweetAlertDialog.NormalType);
     infoDialog.SetTitleText("Info");
     infoDialog.SetContentText(info);
     infoDialog.SetConfirmText("OK");
     infoDialog.ShowCancelButton(false);
     infoDialog.SetConfirmClickListener(null);
     infoDialog.Show();
 }
        public static void ShowWarning(string warn)
        {
            var warnDialog = new SweetAlertDialog(_context, SweetAlertDialog.WarningType);

            warnDialog.SetTitleText("Warning");
            warnDialog.SetContentText(warn);
            warnDialog.SetConfirmText("OK");
            warnDialog.ShowCancelButton(false);
            warnDialog.SetConfirmClickListener(null);
            warnDialog.Show();
        }
        public static void ShowError(string title, string message)
        {
            var errorDialog = new SweetAlertDialog(_context, SweetAlertDialog.ErrorType);

            errorDialog.SetTitleText(title);
            errorDialog.SetContentText(message);
            errorDialog.SetConfirmText("OK");
            errorDialog.ShowCancelButton(false);
            errorDialog.SetConfirmClickListener(null);
            errorDialog.Show();
        }
        public static void CloseProgressDialog()
        {
            if (loadingDialog == null)
            {
                return;
            }

            if (loadingDialog.IsShowing)
            {
                loadingDialog.DismissWithAnimation();
                loadingDialog = null;
            }
        }
 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();
 }
Example #12
0
        public void HomeFragment_TripActionStartTrip(object sender, EventArgs e)
        {
            var startTripAlert = new SweetAlertDialog(this, SweetAlertDialog.WarningType);

            startTripAlert.SetTitleText("Start Trip");
            startTripAlert.SetContentText("Sure to start trip?");
            startTripAlert.SetCancelText("No");
            startTripAlert.SetConfirmText("Yes");
            startTripAlert.SetConfirmClickListener(new SweetConfirmClick(s =>
            {
                statusEnum = RideStatusEnum.Ontrip;
                newTripEventListener.UpdateStatus(statusEnum);
                s.Dismiss();
            }));
            startTripAlert.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();
 }
        public void ShowDialog()
        {
            sweetAlert = new SweetAlertDialog(Context, SweetAlertDialog.WarningType);
            sweetAlert.SetContentText("Your session will be dismissed and all unsaved data lost. Continue?");
            sweetAlert.SetTitleText("Log out?");
            sweetAlert.SetConfirmText("Yes");
            sweetAlert.SetCancelText("No");
            sweetAlert.SetConfirmClickListener(new SweetConfirmClick(alert =>
            {
                editor = preferences.Edit();
                editor.PutString("firstRun", "reg");
                editor.Commit();
                AppDataHelper.GetFirebaseAuth().SignOut();

                var intent = new Intent(Context, typeof(SplashActivity));
                StartActivity(intent);
                alert.DismissWithAnimation();
            }));
            sweetAlert.Show();
        }
 public void OnClick(SweetAlertDialog p0)
 {
     _onClick?.Invoke(p0);
 }
Example #16
0
        private void SetUpRecycler()
        {
            postAdapter = new PostAdapter(this, posts);
            mainRecycler.SetAdapter(postAdapter);
            emptyObserver = new RecyclerViewEmptyObserver(mainRecycler, emptyRoot);
            postAdapter.RegisterAdapterDataObserver(emptyObserver);
            postAdapter.ItemLongClick += (s1, e1) =>
            {
                string postID  = posts[e1.Position].ID;
                string ownerID = posts[e1.Position].OwnerId;

                if (SessionManager.GetFirebaseAuth().CurrentUser.Uid != ownerID)
                {
                    return;
                }

                var sweetDialog = new SweetAlertDialog(this, SweetAlertDialog.WarningType);
                sweetDialog.SetTitleText("Post Options");
                sweetDialog.SetContentText("Do you want to edit or delete selected post?");
                sweetDialog.SetCancelText("Delete");
                sweetDialog.SetConfirmText("Edit");
                sweetDialog.SetConfirmClickListener(new SweetConfirmClick(
                                                        onClick: d1 =>
                {
                    d1.ChangeAlertType(SweetAlertDialog.SuccessType);
                    d1.SetTitleText("Done");
                    d1.SetContentText("");
                    d1.ShowCancelButton(false);
                    d1.SetConfirmText("OK");
                    d1.SetConfirmClickListener(null);
                    d1.Show();
                }));
                sweetDialog.SetCancelClickListener(new SweetConfirmClick(
                                                       onClick: d2 =>
                {
                    SessionManager.GetFireDB().GetReference("posts").Child(postID).RemoveValue()
                    .AddOnCompleteListener(new OncompleteListener((onComplete) =>
                    {
                        switch (onComplete.IsSuccessful)
                        {
                        case false:
                            break;

                        default:
                            StorageReference storageReference = FirebaseStorage.Instance.GetReference("postImages/" + postID);
                            storageReference.DeleteAsync();
                            postAdapter.NotifyItemRemoved(e1.Position);
                            postAdapter.NotifyItemRangeChanged(e1.Position, posts.Count);
                            break;
                        }
                    }));
                    d2.ChangeAlertType(SweetAlertDialog.SuccessType);
                    d2.SetTitleText("Deleted");
                    d2.SetContentText("");
                    d2.ShowCancelButton(false);
                    d2.SetConfirmText("OK");
                    d2.SetConfirmClickListener(null);
                    d2.Show();
                }));
                sweetDialog.Show();
            };

            postAdapter.ItemClick += (s2, e2) =>
            {
                var intent = new Intent(this, typeof(FullscreenImageActivity));

                PostParcelable postParcelable = new PostParcelable();
                postParcelable.PostItem = posts[e2.Position];

                intent.PutExtra(Constants.TRANSITION_NAME, ViewCompat.GetTransitionName(e2.ImageView));
                intent.PutExtra(Constants.POST_DATA_EXTRA, postParcelable);
                intent.PutExtra(Constants.PARCEL_TYPE, 0);
                var options = ActivityOptionsCompat.MakeSceneTransitionAnimation(this, e2.ImageView,
                                                                                 ViewCompat.GetTransitionName(e2.ImageView));
                StartActivity(intent, options.ToBundle());
            };
        }