コード例 #1
0
ファイル: CustomDialogFragment.cs プロジェクト: kjh33191/HTT
        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);
                }
            };
        }