Esempio n. 1
0
        void ShowProgressDialog(string status)
        {
            progressDialog = new ProgressDialogFragment(status);
            var trans = SupportFragmentManager.BeginTransaction();

            progressDialog.Cancelable = false;
            progressDialog.Show(trans, "progress");
        }
Esempio n. 2
0
 void CloseProgressDialog()
 {
     if (progressDialog != null)
     {
         progressDialog.Dismiss();
         progressDialog = null;
     }
 }
Esempio n. 3
0
 private void CloseProgressDialog()
 {
     if (progressDialogFragment != null)
     {
         progressDialogFragment.Dismiss();
         progressDialogFragment = null;
     }
 }
Esempio n. 4
0
            public static ProgressDialogFragment create(int message)
            {
                ProgressDialogFragment progressDialogFragment = new ProgressDialogFragment();
                Bundle args = new Bundle();

                args.PutInt(ARG_MESSAGE, message);
                progressDialogFragment.SetArguments(args);
                return(progressDialogFragment);
            }
        protected override void OnPreExecute()
        {
            progressDialog = new ProgressDialogFragment(context.GetString(Resource.String.text_download_file));
            var tran = context.SupportFragmentManager.BeginTransaction();

            progressDialog.Cancelable = false;
            progressDialog.Show(tran, context.GetString(Resource.String.text_name_fragment_progress));
            base.OnPreExecute();
        }
Esempio n. 6
0
 public void SetMessageResource(int resId)
 {
     if (mProgressFragment.IsVisible)
     {
         mProgressFragment.Dismiss();
         mProgressFragment = null;
     }
     mProgressFragment = ProgressDialogFragment.NewInstance(resId);
 }
Esempio n. 7
0
        internal static bool ShowLoading(Context context, string message)
        {
            ((Activity)context).RunOnUiThread(() =>
            {
                _progressDialog = new ProgressDialogFragment();
                _progressDialog.Initialize(context, message, string.Empty);
                _progressDialog.Show();
            });

            return(true);
        }
Esempio n. 8
0
        internal static bool DismissLoading()
        {
            if (_progressDialog == null)
            {
                return(false);
            }

            _progressDialog.Dismiss();
            _progressDialog = null;
            return(true);
        }
Esempio n. 9
0
        private void showProgressDialog()
        {
            DialogFragment progressDialog =
                (DialogFragment)GetFragmentManager().FindFragmentByTag(TAG_PROGRESS_DIALOG);

            if (progressDialog == null)
            {
                progressDialog = ProgressDialogFragment.create();
                progressDialog.Show(GetFragmentManager(), TAG_PROGRESS_DIALOG);
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.main);

            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetIcon(Resource.Drawable.img_avast_logo_small);

            FindViewById(Resource.Id.message_dialog).Click += (sender, e) =>
            {
                SimpleDialogFragment.CreateBuilder(this, SupportFragmentManager).SetMessage("Love. Can know all the math in the \'verse but take a boat in the air that you don\'t " + "love? She\'ll shake you off just as sure as a turn in the worlds. Love keeps her in the air when " + "she oughtta fall down...tell you she\'s hurtin\' \'fore she keens...makes her a home.").Show();
            };
            FindViewById(Resource.Id.message_title_dialog).Click += (sender, e) =>
            {
                SimpleDialogFragment.CreateBuilder(this, SupportFragmentManager).SetTitle("More Firefly quotes:").SetMessage("Wash: \"Psychic, though? That sounds like something out of science fiction.\"\n\nZoe: \"We live" + " " + "in a space ship, dear.\"\nWash: \"Here lies my beloved Zoe, " + ("my autumn flower ... somewhat less attractive now that she's all corpsified and gross" + ".\"\n\nRiver Tam: \"Also? I can kill you with my brain.\"\n\nKayle: \"Going on a year now, nothins twixed my neathers not run on batteries.\" \n" + "Mal: \"I can't know that.\" \n" + "Jayne: \"I can stand to hear a little more.\"\n\nWash: \"I've been under fire before. " + "Well ... I've been in a fire. Actually, I was fired. I can handle myself.\"")).SetNegativeButtonText("Close").Show();
            };
            FindViewById(Resource.Id.message_title_buttons_dialog).Click += (sender, e) =>
            {
                SimpleDialogFragment.CreateBuilder(this, SupportFragmentManager).SetTitle("Do you like this quote?").SetMessage("Jayne: \"Shiny. Let's be bad guys.\"").SetPositiveButtonText("Love").SetNegativeButtonText("Hate").SetNeutralButtonText("WTF?").SetRequestCode(REQUEST_SIMPLE_DIALOG).Show();
            };
            FindViewById(Resource.Id.long_buttons).Click += (sender, e) =>
            {
                SimpleDialogFragment.CreateBuilder(this, SupportFragmentManager).SetMessage("How will you decide?").SetPositiveButtonText("Time for some thrillin' heroics!").SetNegativeButtonText("Misbehave").SetNeutralButtonText("Keep flying").Show();
            };
            FindViewById(Resource.Id.progress_dialog).Click += (sender, e) =>
            {
                ProgressDialogFragment.CreateBuilder(this, SupportFragmentManager).SetMessage("Mal: I\'m just waiting to see if I pass out. Long story.").SetRequestCode(REQUEST_PROGRESS).Show();
            };
            FindViewById(Resource.Id.list_dialog_simple).Click += (sender, e) =>
            {
                ListDialogFragment.CreateBuilder(this, SupportFragmentManager).SetTitle("Your favorite character:").SetItems(new string[] { "Jayne", "Malcolm", "Kaylee", "Wash", "Zoe", "River" }).SetRequestCode(REQUEST_LIST_SIMPLE).Show();
            };
            FindViewById(Resource.Id.list_dialog_single).Click += (sender, e) =>
            {
                ListDialogFragment.CreateBuilder(this, SupportFragmentManager).SetTitle("Your favorite character:").SetItems(new string[] { "Jayne", "Malcolm", "Kaylee", "Wash", "Zoe", "River" }).SetRequestCode(REQUEST_LIST_SINGLE).SetChoiceMode(AbsListViewChoiceMode.Single).Show();
            };
            FindViewById(Resource.Id.list_dialog_multiple).Click += (sender, e) =>
            {
                ListDialogFragment.CreateBuilder(this, SupportFragmentManager).SetTitle("Your favorite character:").SetItems(new string[] { "Jayne", "Malcolm", "Kaylee", "Wash", "Zoe", "River" }).SetRequestCode(REQUEST_LIST_MULTIPLE).SetChoiceMode(AbsListViewChoiceMode.Multiple).SetCheckedItems(new int[] { 1, 3 }).Show();
            };
            FindViewById(Resource.Id.custom_dialog).Click += (sender, e) =>
            {
                JayneHatDialogFragment.Show(this);
            };
            FindViewById(Resource.Id.time_picker).Click += (sender, e) =>
            {
                TimePickerDialogFragment.CreateBuilder(this, SupportFragmentManager).SetDate(new Date()).SetPositiveButtonText(Android.Resource.String.Ok).SetNegativeButtonText(Android.Resource.String.Cancel).SetRequestCode(REQUEST_TIME_PICKER).Show();
            };
            FindViewById(Resource.Id.date_picker).Click += (sender, e) =>
            {
                DatePickerDialogFragment.CreateBuilder(this, SupportFragmentManager).SetDate(new Date()).SetPositiveButtonText(Android.Resource.String.Ok).SetNegativeButtonText(Android.Resource.String.Cancel).SetRequestCode(REQUEST_DATE_PICKER).Show();
            };
        }
        protected override void OnPostExecute([AllowNull] string result)
        {
            var storagePath = Android.OS.Environment.ExternalStorageDirectory.Path;
            var filePath    = System.IO.Path.Combine(storagePath, $"{fileName}.jpg");

            if (progressDialog != null)
            {
                progressDialog.Dismiss();
                progressDialog = null;
            }
            imageView.SetImageDrawable(Drawable.CreateFromPath(filePath));
        }
Esempio n. 12
0
 public ProgressDialogController(Android.Support.V4.App.FragmentManager fragmentManager)
 {
     mFragmentManager  = fragmentManager;
     mProgressFragment = ProgressDialogFragment.NewInstance(Resource.String.progressMessage);
 }
 public static ProgressDialogFragment create(int message)
 {
    ProgressDialogFragment progressDialogFragment = new ProgressDialogFragment();
    Bundle args = new Bundle();
    args.PutInt(ARG_MESSAGE, message);
    progressDialogFragment.SetArguments(args);
    return progressDialogFragment;
 }