示例#1
0
        public IProgressDialog Progress(Activity activity, ProgressConfig config)
        {
            if (_progress != null && _progress.IsShowing)
            {
                _progress.Dismiss();
            }

            _progress = KProgressHUD.Create(activity, KProgressHUD.Style.PieDeterminate).SetLabel(config.Text);

            _progress.SetMaxProgress(100);

            _progress.SetCancellable(config.Cancellable);

            if (config.Cancellable)
            {
                _progress.SetCancelAction(() =>
                {
                    _progress.Dismiss();

                    config.CancelAction?.Invoke();
                });
            }

            if (config.MarkType == MarkType.Black)
            {
                _progress.SetDimAmount(0.5f);
            }

            _progress.Show();

            return(new LoadingDialog(_progress));
        }
        private void SimulateProgressUpdate()
        {
            hud.SetMaxProgress(100);
            currentProgress = 0;

            Handler handler = new Handler();

            Run(handler);
        }