Beispiel #1
0
        public static OnboardingContentView ContentViewOnView(UIView view, IOnboardingContentViewDelegate delegateView, int itemCounts, nfloat bottomConstraints)
        {
            var contentView = new OnboardingContentView(itemCounts, delegateView);

            contentView.BackgroundColor = UIColor.Clear;
            contentView.TranslatesAutoresizingMaskIntoConstraints = false;

            view.AddSubview(contentView);

            //Add constraints
            (view, contentView).ConstraintOps((obj) => obj.Attribute = NSLayoutAttribute.Left);
            (view, contentView).ConstraintOps((obj) => obj.Attribute = NSLayoutAttribute.Right);
            (view, contentView).ConstraintOps((obj) => obj.Attribute = NSLayoutAttribute.Top);
            (view, contentView).ConstraintOps((obj) =>
            {
                obj.Attribute = NSLayoutAttribute.Bottom;
                obj.Constant  = bottomConstraints;
            });

            return(contentView);
        }
Beispiel #2
0
        private void Initialize()
        {
            if (_dataSource != null)
            {
                ItemsCounts            = _dataSource.OnboardingItemsCount();
                pageViewRadius         = _dataSource.OnboardingPageItemRadius();
                pageViewSelectedRadius = _dataSource.OnboardingPageItemSelectedRadius();
            }

            itemsInfo = CreateItemsInfo();
            this.TranslatesAutoresizingMaskIntoConstraints = false;
            fillAnimationView = FillAnimationView.AnimationViewOnView(this, GetItemColor(CurrentIndex));
            contentView       = OnboardingContentView.ContentViewOnView(this,
                                                                        this,
                                                                        ItemsCounts,
                                                                        pageViewBottomConstant * -1 - pageViewSelectedRadius);

            pageView       = CreatePageView();
            gestureControl = new GestureControl(this, this);

            var tapGesture = new UITapGestureRecognizer(HandleAction);

            this.AddGestureRecognizer(tapGesture);
        }