public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.FromRGB(237, 85, 101);

            var cols       = 4;
            var rows       = 8;
            var cellWidth  = (int)(View.Bounds.Size.Width / cols);
            var cellHeight = (int)(View.Bounds.Size.Height / rows);

            var enumValues = Enum.GetValues(typeof(DGActivityIndicatorAnimationType)).Cast <DGActivityIndicatorAnimationType>();

            for (int i = 0; i < enumValues.Count(); i++)
            {
                int x = i % cols * cellWidth;
                int y = i / cols * cellHeight;

                var activityIndicatorView = new DGActivityIndicatorView(enumValues.ElementAt(i), UIColor.White);

                activityIndicatorView.Frame  = new CGRect(x, y, cellWidth, cellHeight);
                activityIndicatorView.Bounds = activityIndicatorView.Frame;

                var label = new UILabel(new CGRect(x, y + (cellHeight - activityIndicatorView.Frame.Size.Height), cellWidth, cellHeight));
                label.Text      = i.ToString();
                label.TextColor = UIColor.White;
                label.Font      = label.Font.WithSize(12f);

                View.AddSubview(activityIndicatorView);
                View.AddSubview(label);

                activityIndicatorView.StartAnimating();
            }
        }
Exemplo n.º 2
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            InitDoneButton();

            AddGestureRecognizer(PostFoodMarkerCloseBtn, CloseButtonPressed);
            AddGestureRecognizer(AddMediaBtn, AddMediaBtnPressed);
            AddGestureRecognizer(SeeMediaBtn, SeeMediaBtnPressed);
            AddGestureRecognizer(PostFoodMarkerOkButton, OkButtonPressed);

            PostFoodMarkerComment.Started += MoveViewToTop;
            PostFoodMarkerComment.Ended   += MoveViewToBottom;

            UIPickerView pickerView = new UIPickerView();
            var          model      = new CategoryModel(PostFoodMarkerCategory);
            await model.InitCat();

            pickerView.Model = model;
            PostFoodMarkerCategory.InputView = pickerView;

            SetMediaPickerEventHandlers();

            _activityIndicatorView =
                new DGActivityIndicatorView(DGActivityIndicatorAnimationType.BallBeat,
                                            UIColor.Green);
            _activityIndicatorView.Center = new CoreGraphics.CGPoint(View.Center.X, PostFoodMarkerOkButton.Center.Y);
            View.AddSubview(_activityIndicatorView);
        }
Exemplo n.º 3
0
        public ACProgressView(CGRect frame) : base(frame)
        {
            // configurable bits
            BackgroundColor  = UIColor.Clear;
            Alpha            = 0.75f;
            AutoresizingMask = UIViewAutoresizing.All;

            nfloat labelHeight = 22;
            nfloat labelWidth  = Frame.Width - 20;

            // derive the center x and y
            nfloat centerX = Frame.Width / 2;
            nfloat centerY = Frame.Height / 2;

            //Console.WriteLine("\nFrame center Width = {0} and Frame center Hight = {1}\n",centerX, centerY);



            cloud           = new UIImageView(UIImage.FromBundle("cloud"));
            cloud.Frame     = new CGRect(centerX - (cloud.Image.CGImage.Width / 2), centerY - (cloud.Image.CGImage.Height / 2) - 20, cloud.Image.CGImage.Width, cloud.Image.CGImage.Height);
            cloud.TintColor = UIColor.White;
            //     # imageLiteral(resourceName: "cloud")
            //   # imageLiteral(resourceNaUIImage.FromBundle("cloud_off")me: "cloud_done")
            //UIImage.FromBundle("cloud_off")
            //activitySpinner.AutoresizingMask = UIViewAutoresizing.All;
            double size = cloud.Image.CGImage.Width * 1.9;
            nfloat s    = (nfloat)size;

            activitySpinner       = new DGActivityIndicatorView(DGActivityIndicatorAnimationType.BallClipRotate, UIColor.White, cloud.Image.CGImage.Width * 2);
            activitySpinner.Frame = new CGRect(centerX - (activitySpinner.Frame.Width / 2), centerY - activitySpinner.Frame.Height - 20, activitySpinner.Frame.Width, activitySpinner.Frame.Height);
            //activitySpinner.Bounds = frame;

            AddSubview(activitySpinner);
            AddSubview(cloud);
            activitySpinner.StartAnimating();

            // create and configure the "Loading Data" label
            textLabel = new UILabel(new CGRect(
                                        centerX - (labelWidth / 2),
                                        centerY + 50,
                                        labelWidth,
                                        labelHeight
                                        ));
            textLabel.BackgroundColor  = UIColor.Clear;
            textLabel.TextColor        = UIColor.White;
            textLabel.Text             = "Service unavailable on this address";
            textLabel.TextAlignment    = UITextAlignment.Center;
            textLabel.AutoresizingMask = UIViewAutoresizing.All;
            textLabel.Font             = textLabel.Font.WithSize(14);
            AddSubview(textLabel);



            //activitySpinner.StopAnimating();
            //  delay(cloud);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.FromRGB(237, 85, 101);

            // Thats a 🔨 way of getting safearea insets.
            var window        = UIApplication.SharedApplication.Windows?.FirstOrDefault();
            var topPadding    = window?.SafeAreaInsets.Top ?? 0;
            var bottomPadding = window?.SafeAreaInsets.Bottom ?? 0;

            var cols       = 4;
            var rows       = 9;
            var cellWidth  = View.Bounds.Size.Width / cols;
            var cellHeight = (View.Bounds.Size.Height - (topPadding + bottomPadding)) / rows;

            var enumValues = Enum.GetValues(typeof(DGActivityIndicatorAnimationType)).Cast <DGActivityIndicatorAnimationType>();

            for (int i = 0; i < enumValues.Count(); i++)
            {
                var x = i % cols * cellWidth;
                var y = (i / cols * cellHeight) + topPadding;

                var activityIndicatorView = new DGActivityIndicatorView(enumValues.ElementAt(i), UIColor.White)
                {
                    TranslatesAutoresizingMaskIntoConstraints = false
                };
                var label = new UILabel
                {
                    TranslatesAutoresizingMaskIntoConstraints = false,
                    Text          = enumValues.ElementAt(i).ToString(),
                    TextColor     = UIColor.White,
                    TextAlignment = UITextAlignment.Center
                };
                label.Font = label.Font.WithSize(9f);

                View.AddSubview(activityIndicatorView);
                activityIndicatorView.AddSubview(label);

                activityIndicatorView.HeightAnchor.ConstraintEqualTo(cellHeight).Active             = true;
                activityIndicatorView.WidthAnchor.ConstraintEqualTo(cellWidth).Active               = true;
                activityIndicatorView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor, x).Active = true;
                activityIndicatorView.TopAnchor.ConstraintEqualTo(View.TopAnchor, y).Active         = true;

                label.LeadingAnchor.ConstraintEqualTo(activityIndicatorView.LeadingAnchor).Active   = true;
                label.TrailingAnchor.ConstraintEqualTo(activityIndicatorView.TrailingAnchor).Active = true;
                label.TopAnchor.ConstraintEqualTo(activityIndicatorView.TopAnchor).Active           = true;

                activityIndicatorView.StartAnimating();
            }
        }