public void ShowNormalDialog(string title, string content = null, string positiveText = null, string negativeText = null)
        {
            try
            {
                MaterialDialog.Builder dialogList = new MaterialDialog.Builder(ActivityContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light);

                if (!string.IsNullOrEmpty(title))
                {
                    dialogList.Title(title);
                }

                if (!string.IsNullOrEmpty(content))
                {
                    dialogList.Content(content);
                }

                if (!string.IsNullOrEmpty(negativeText))
                {
                    dialogList.NegativeText(negativeText);
                    dialogList.OnNegative(this);
                }

                if (!string.IsNullOrEmpty(positiveText))
                {
                    dialogList.PositiveText(positiveText);
                    dialogList.OnPositive(this);
                }

                dialogList.Build().Show();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Beispiel #2
0
        public void ShowNormalDialog(string title, string content = null, string positiveText = null, string negativeText = null)
        {
            try
            {
                MaterialDialog.Builder DialogList = new MaterialDialog.Builder(ActivityContext);

                if (!string.IsNullOrEmpty(title))
                {
                    DialogList.Title(title);
                }

                if (!string.IsNullOrEmpty(content))
                {
                    DialogList.Content(content);
                }

                if (!string.IsNullOrEmpty(negativeText))
                {
                    DialogList.NegativeText(negativeText);
                    DialogList.OnNegative(this);
                }

                if (!string.IsNullOrEmpty(positiveText))
                {
                    DialogList.PositiveText(positiveText);
                    DialogList.OnPositive(this);
                }

                DialogList.Build().Show();
            }
            catch (Exception exception)
            {
                Crashes.TrackError(exception);
            }
        }
Beispiel #3
0
        private Task <string> OnJavascriptInjectionRequest(string eventobj)
        {
            try
            {
                if (!string.IsNullOrEmpty(eventobj))
                {
                    if (eventobj.Contains("type"))
                    {
                        var data = JsonConvert.DeserializeObject <Dictionary <string, object> >(eventobj);
                        var type = data["type"].ToString();

                        if (type == "delete_post")
                        {
                            Activity.RunOnUiThread(() =>
                            {
                                try
                                {
                                    var DialogList = new MaterialDialog.Builder(Context);
                                    DialogList.Tag(data["post_id"].ToString());
                                    DialogList.Title(Context.GetText(Resource.String.Lbl_Title_DeletePost));
                                    DialogList.Content(Context.GetText(Resource.String.Lbl_Content_DeletePost));
                                    DialogList.NegativeText(Context.GetText(Resource.String.Lbl_Cancel));
                                    DialogList.OnNegative(this);
                                    DialogList.PositiveText(Context.GetText(Resource.String.Lbl_Delete));
                                    DialogList.OnPositive(this);
                                    DialogList.Build().Show();
                                }
                                catch (Exception exception)
                                {
                                    Crashes.TrackError(exception);
                                }
                            });
                        }
                        else if (type == "publisher-box")
                        {
                            Activity.RunOnUiThread(() =>
                            {
                                var Int = new Intent(Activity, typeof(AddPost_Activity));
                                Int.PutExtra("Type", "Normal");
                                Int.PutExtra("PostId", UserDetails.User_id);
                                Int.PutExtra("isOwner", "Normal");
                                StartActivityForResult(Int, 2500);
                            });
                        }
                        else
                        {
                            return(null);
                        }
                    }
                }

                return(null);
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
                return(null);
            }
        }
Beispiel #4
0
        public void ShowEditTextDialog(string title, string content = null, string positiveText = null, string negativeText = null)
        {
            try
            {
                MaterialDialog.Builder DialogList = new MaterialDialog.Builder(ActivityContext);

                if (!string.IsNullOrEmpty(title))
                {
                    DialogList.Title(title);
                }

                if (!string.IsNullOrEmpty(content))
                {
                    DialogList.Content(content);
                }

                if (!string.IsNullOrEmpty(negativeText))
                {
                    DialogList.NegativeText(negativeText);
                    DialogList.OnNegative(this);
                }

                if (!string.IsNullOrEmpty(positiveText))
                {
                    DialogList.PositiveText(positiveText);
                    DialogList.OnPositive(this);
                }

                DialogList.InputType(InputTypes.ClassText | InputTypes.TextFlagMultiLine);
                DialogList.Input("", "", this);
                DialogList.Build().Show();
            }
            catch (Exception exception)
            {
                Crashes.TrackError(exception);
            }
        }