Пример #1
0
        public static CustomDialogFragment newInstance(String mainMsg)
        {
            Bundle bundle = new Bundle();

            bundle.PutString(ARG_DIALOG_MAIN_MSG, mainMsg);
            CustomDialogFragment fragment = new CustomDialogFragment
            {
                Arguments = bundle
            };

            return(fragment);
        }
Пример #2
0
        public void ShowDialog(string title, string body, Action callback)
        {
            Bundle bundle = new Bundle();

            bundle.PutString("title", title);
            bundle.PutString("body", body);

            CustomDialogFragment dialog = new CustomDialogFragment {
                Arguments = bundle
            };

            dialog.Cancelable = false;
            dialog.Show(FragmentManager, "");
            dialog.Dismissed += (s, e) => {
                //Toast.MakeText(this.Activity, e.Text, ToastLength.Long).Show();
                callback?.Invoke();
            };
        }
Пример #3
0
        public void ShowDialog(string title, string body, Action <bool> callback)
        {
            Bundle bundle = new Bundle();

            bundle.PutString("title", title);
            bundle.PutString("body", body);

            CustomDialogFragment dialog = new CustomDialogFragment {
                Arguments = bundle
            };

            dialog.Cancelable = false;
            dialog.Show(FragmentManager, "");
            dialog.Dismissed += (s, e) => {
                if (e.Text == "true")
                {
                    callback(true);
                }
                else
                {
                    callback(false);
                }
            };
        }