コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CollectionView.ContentInset =
                new UIEdgeInsets(0, 0,
                                 TabBarController.TabBar.Bounds.Size.Height, 0);

            AddChildViewController(appBar.HeaderViewController);



            appBar.HeaderViewController.HeaderView.TrackingScrollView =
                CollectionView;
            appBar.HeaderViewController.HeaderView.BackgroundColor =
                UIColor.White;
            appBar.HeaderViewController.HeaderView.MaximumHeight = 440;
            appBar.HeaderViewController.HeaderView.MinimumHeight = 72;
            appBar.AddSubviewsToParent();

            if (isHome)
            {
                SetupHeaderContentView();
                SetupHeaderLogo();
            }

            Title = TabBarItem.Title;

            Styler.CellStyle      = MDCCollectionViewCellStyle.Card;
            Styler.CellLayoutType = MDCCollectionViewCellLayoutType.Grid;
            Styler.GridPadding    = 8;

            UpdateLayout();
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // FIXME: Does not work if Styling is an Abstract Class
            var styler = this.Styler;

            styler.CellStyle = MDCCollectionViewCellStyle.Card;

            appBar.HeaderViewController.HeaderView.TrackingScrollView = CollectionView;
            appBar.AddSubviewsToParent();

            var backButon = new UIBarButtonItem("", UIBarButtonItemStyle.Done, (sender, e) => {
                DismissViewController(true, null);
            });

            var backImage = UIImage.FromBundle("Back");

            backButon.Image = backImage;

            NavigationItem.LeftBarButtonItem  = backButon;
            NavigationItem.RightBarButtonItem = null;

            CollectionView.RegisterClassForCell(typeof(MDCCollectionViewTextCell), cellId);

            CollectionView.RegisterClassForSupplementaryView(typeof(MDCCollectionViewTextCell),
                                                             UICollectionElementKindSection.Header,
                                                             headerId);
        }
コード例 #3
0
        public override void ViewDidLoad()
        {
            //ase.ViewDidLoad();

            var detailView = new ShrineDetailView(View.Frame);

            detailView.title            = productTitle;
            detailView.desc             = desc;
            detailView.imageName        = imageName;
            detailView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth |
                                          UIViewAutoresizing.FlexibleHeight;
            View.AddSubview(detailView);

            appBar.AddSubviewsToParent();
            string title = "";

            var backButton = new UIBarButtonItem(title, UIBarButtonItemStyle.Done, DismissDetails);

            var backImage = new UIImage(MDCIcons.PathFor_ic_arrow_back);

            backButton.Image = backImage;
            appBar.NavigationBar.LeftBarButtonItem = backButton;

            floatingButton.SetTitle("+", UIControlState.Normal);
            floatingButton.SetTitle("-", UIControlState.Selected);
            floatingButton.BackgroundColor = new UIColor(0.086f, 0.941f, 0.941f, 1f);
            floatingButton.SizeToFit();
            View.AddSubview(floatingButton);
        }
コード例 #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // FIXME: Does not work if Styling is an Abstract Class
            var styler = this.Styler;

            styler.CellStyle = MDCCollectionViewCellStyle.Card;

            AddChildViewController(appBar.HeaderViewController);
            appBar.HeaderViewController.HeaderView.BackgroundColor = new UIColor(1f, 0.76f, 0.03f, 1.0f);

            var cv = CollectionView;

            appBar.HeaderViewController.HeaderView.TrackingScrollView = CollectionView;
            appBar.AddSubviewsToParent();

            Title = "Material";

            // FIXME: Does not work.
            navBtn = new UIBarButtonItem(UIBarButtonSystemItem.Done, null)
            {
                Title = "Edit",
                Style = UIBarButtonItemStyle.Plain
            };
            navBtn.Clicked += OnDoneClicked;

            //this.NavigationItem.SetRightBarButtonItem(
            //	new UIBarButtonItem(UIBarButtonSystemItem.Action, (sender, args) => {
            //        // button was clicked
            //       Console.WriteLine("UIBarButtonItem");
            //       })
            //, true);
            NavigationItem.SetLeftBarButtonItem(navBtn, true);
            //base.NavigationItem.
            appBar.NavigationBar.TintColor = UIColor.Black;

            //FIXME: Does not work if MDCCollectionViewEditing is an Abstract Class
            this.Editor.Editing = false;             //true;

            Add(fab);
            fab.TranslatesAutoresizingMaskIntoConstraints = false;
            fab.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor, -16.0f).Active = true;
            fab.BottomAnchor.ConstraintEqualTo(View.BottomAnchor, -16.0f).Active     = true;

            fab.SetTitle("+", UIControlState.Normal);
            fab.SetTitle("-", UIControlState.Selected);
            fab.AddTarget(FabDidTap, UIControlEvent.TouchUpInside);
        }
コード例 #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            appBar.AddSubviewsToParent();

            zoomableCardView = new UIView(CGRect.Empty);
            zoomableCardView.BackgroundColor = UIColor.White;
            View.AddSubview(zoomableCardView);

            zoomableView = new UIImageView(CGRect.Empty);
            zoomableView.BackgroundColor = UIColor.LightGray;
            zoomableView.ContentMode     = UIViewContentMode.ScaleAspectFill;
            View.AddSubview(zoomableView);
        }
コード例 #6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (View.Frame.Size.Height > View.Frame.Size.Width)
            {
                fhvc.HeaderView.MinimumHeight = PestoDetail.FlexibleHeaderMinHeight;
            }
            else
            {
                fhvc.HeaderView.MinimumHeight = PestoDetail.FlexibleHeaderLandscapeHeight;
                fhvc.HeaderView.MaximumHeight = PestoDetail.FlexibleHeaderLandscapeHeight;
            }

            scrollView = new UIScrollView(View.Bounds);
            scrollView.BackgroundColor  = UIColor.White;
            scrollView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth |
                                          UIViewAutoresizing.FlexibleHeight;

            View.AddSubview(scrollView);

            scrollView.Delegate = this;
            fhvc.HeaderView.TrackingScrollView = scrollView;
            fhvc.HeaderView.ClipsToBounds      = true;

            fhvc.View.Frame = View.Bounds;
            View.AddSubview(fhvc.View);

            fhvc.DidMoveToParentViewController(this);


            var bottomFrame = new CGRect(0, 0, View.Bounds.Size.Width,
                                         PestoDetail.RecipeCardHeight);

            bottomView = new PestoRecipeCardView(bottomFrame);

            bottomView.DescText         = this.descText;
            bottomView.Title            = this.Title;
            bottomView.IconImageName    = this.iconImageName;
            bottomView.Alpha            = 0;
            bottomView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth |
                                          UIViewAutoresizing.FlexibleHeight;
            scrollView.AddSubview(bottomView);

            DispatchQueue.MainQueue.DispatchAsync(() => {
                UIView.AnimateNotify(PestoDetail.AnimationDuration,
                                     PestoDetail.AnimationDelay,
                                     UIViewAnimationOptions.CurveEaseOut,
                                     () =>
                {
                    var quantumEaseInOut = MDC_CAMediaTimingFunction.Mdc_functionWithType(MDCAnimationTimingFunction.EaseInOut);
                    CATransaction.AnimationTimingFunction = quantumEaseInOut;
                    this.bottomView.Alpha = 1f;
                },
                                     new UICompletionHandler((bool finished) => {}));
            });

            appBar.AddSubviewsToParent();

            // Only display title in the bottom view with no title in the app bar.
            bottomView.Title           = Title;
            appBar.NavigationBar.Title = "";
        }