Ejemplo n.º 1
0
        private void InitializeActivitySpinner(UIColor spinnerColor)
        {
            CGRect activitySpinnerBounds =
                new CGRect(
                    this.Frame.GetMidX() - Constants.ActivitySpinnerHalfSize,
                    this.Frame.GetMidY() - Constants.ActivitySpinnerHalfSize,
                    Constants.ActivitySpinnerSize,
                    Constants.ActivitySpinnerSize);

            UIView activitySpinnerView = new UIView(activitySpinnerBounds);
            ActivitySpinnerRenderer activitySpinnerRenderer = new ActivitySpinnerRenderer(activitySpinnerView, spinnerColor);

            activitySpinnerRenderer.RenderToViewWithAnimation();

            this.AddSubview(activitySpinnerView);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets that an image download is in progress and shows a progress indicator.
        /// </summary>
        public void SetImageDownloadInProgress()
        {
            if (this.IsImageDownloadInProgress)
            {
                throw new InvalidOperationException("Image download already in progress.");
            }

            if (this.ShowActivitySpinnerWhenDownloadingImage)
            {
                this.activitySpinnerView = new UIView();
                this.GetImageView().AddSubview(activitySpinnerView);

                this.CenterDownloadProgressIndicator();

                ActivitySpinnerRenderer activitySpinnerRenderer = new ActivitySpinnerRenderer(activitySpinnerView, this.ActivitySpinnerColor, Constants.ActivitySpinnerLineWidth);
                activitySpinnerRenderer.RenderToViewWithAnimation();
            }

            this.IsImageDownloadInProgress = true;
        }