Example #1
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            flowLayout = new UICollectionViewFlowLayout()
            {
                HeaderReferenceSize     = new CGSize(100, 100),
                SectionInset            = new UIEdgeInsets(20, 20, 20, 20),
                ScrollDirection         = UICollectionViewScrollDirection.Vertical,
                MinimumInteritemSpacing = 50,           // minimum spacing between cells
                MinimumLineSpacing      = 50            // minimum spacing between rows if ScrollDirection is Vertical or between columns if Horizontal
            };

            // Line Layout
            lineLayout = new LineLayout()
            {
                HeaderReferenceSize = new CGSize(160, 100),
                ScrollDirection     = UICollectionViewScrollDirection.Horizontal
            };

            // Circle Layout
            circleLayout         = new CircleLayout();
            FourthViewController = new FourthViewController(circleLayout);

            FourthViewController.CollectionView.ContentInset = new UIEdgeInsets(50, 0, 0, 0);
            UIWindow window;

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.RootViewController = FourthViewController;
            window.MakeKeyAndVisible();


            return(true);
        }
        private void LoadCollectionView()
        {
            featuresLayout = new UICollectionViewFlowLayout();
            featuresLayout.ScrollDirection         = UICollectionViewScrollDirection.Horizontal;
            featuresCollectionView                 = new UICollectionView(CGRect.Empty, featuresLayout);
            featuresCollectionView.DataSource      = new FeatureSamplesDataSource(FeaturesCollections, this);
            featuresCollectionView.Delegate        = new ChartSamplesDelegate(FeaturesCollections);
            featuresCollectionView.BackgroundColor = Utility.BackgroundColor;
            featuresCollectionView.Hidden          = true;
            UINib featureNib = UINib.FromName("TextCell", null);

            featuresCollectionView.RegisterNibForCell(featureNib, "textReuseCell");
            this.View.AddSubview(featuresCollectionView);

            typesLayout = new UICollectionViewFlowLayout();
            typesLayout.ScrollDirection         = UICollectionViewScrollDirection.Horizontal;
            typesCollectionView                 = new UICollectionView(CGRect.Empty, typesLayout);
            typesCollectionView.DataSource      = new TypeSamplesDataSource(TypesCollections, this);
            typesCollectionView.Delegate        = new ChartSamplesDelegate(TypesCollections);
            typesCollectionView.BackgroundColor = Utility.BackgroundColor;
            featuresCollectionView.Hidden       = true;
            UINib typeNib = UINib.FromName("TextCell", null);

            typesCollectionView.RegisterNibForCell(typeNib, "textReuseCell");
            this.View.AddSubview(typesCollectionView);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "Select an Image";

            var images = new List <UIImage>();

            foreach (string imageId in imageIds)
            {
                images.Add(UIImage.FromBundle(imageId));
            }

            collectionView.RegisterClassForCell(typeof(ImageCell), ImageCollectionViewSource.IMAGE_CELL_ID);
            var layout = new UICollectionViewFlowLayout();

            layout.ItemSize = new CGSize(collectionView.Bounds.Width, 200);
            collectionView.CollectionViewLayout = layout;

            collectionView.Source = new ImageCollectionViewSource(images, id =>
            {
                var controller   = (AsciiViewController)Storyboard.InstantiateViewController("AsciiViewController");
                controller.Image = images[id];
                NavigationController.PushViewController(controller, true);
            });
        }
Example #4
0
        public void BindClicks(UIButton btnMan, UIButton btnSec)
        {
            btnMan.TouchUpInside += (sender, e) =>
            {
                //NavigationController.PushViewController(myList, false);
                nfloat width = UIScreen.MainScreen.Bounds.Width;
                width = width / 2 - 15;

                UICollectionViewFlowLayout flowLayout;
                flowLayout = new UICollectionViewFlowLayout()
                {
                    //HeaderReferenceSize = new CGSize(width, 275.0f),
                    ItemSize     = new CGSize(width, 325.0f),
                    SectionInset = new UIEdgeInsets(10.0f, 10.0f, 10.0f, 10.0f),
                    //SectionInset = new UIEdgeInsets(20, 20, 20, 20),
                    ScrollDirection = UICollectionViewScrollDirection.Vertical
                                      //MinimumInteritemSpacing = 50, // minimum spacing between cells
                                      //MinimumLineSpacing = 50 // minimum spacing between rows if ScrollDirection is Vertical or between columns if Horizontal
                };
                NavigationController.PushViewController(new PhyCollectionView(flowLayout), false);
            };
            btnSec.TouchUpInside += (sender, e) => {
                NavigationController.PushViewController(new DetailViewController(), false);
            };
        }
Example #5
0
        public override void ViewDidLayoutSubviews()
        {
            UICollectionViewFlowLayout layout = new UICollectionViewFlowLayout();

            layout.ItemSize = new CoreGraphics.CGSize((float)(collectionView.Window.Frame.Size.Width / 4), (float)(collectionView.Window.Frame.Size.Width / 4));
            collectionView.SetCollectionViewLayout(layout, true);
        }
Example #6
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            // Flow Layout
            flowLayout = new UICollectionViewFlowLayout (){
                HeaderReferenceSize = new System.Drawing.SizeF (100, 100),
                SectionInset = new UIEdgeInsets (20,20,20,20),
                ScrollDirection = UICollectionViewScrollDirection.Vertical,
                MinimumInteritemSpacing = 50, // minimum spacing between cells
                MinimumLineSpacing = 50 // minimum spacing between rows if ScrollDirection is Vertical or between columns if Horizontal
            };

            // Line Layout
            lineLayout = new LineLayout (){
                HeaderReferenceSize = new System.Drawing.SizeF (160, 100),
                ScrollDirection = UICollectionViewScrollDirection.Horizontal
            };

            // Circle Layout
            circleLayout = new CircleLayout ();

            simpleCollectionViewController = new SimpleCollectionViewController (flowLayout);
            //            simpleCollectionViewController = new SimpleCollectionViewController (lineLayout);
            //            simpleCollectionViewController = new SimpleCollectionViewController (circleLayout);

            simpleCollectionViewController.CollectionView.ContentInset = new UIEdgeInsets (50, 0, 0, 0);

            window.RootViewController = simpleCollectionViewController;
            window.MakeKeyAndVisible ();

            return true;
        }
Example #7
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            // Flow Layout
            flowLayout = new UICollectionViewFlowLayout()
            {
                HeaderReferenceSize = new System.Drawing.SizeF(100, 100),
                SectionInset        = new UIEdgeInsets(20, 20, 20, 20),
                ScrollDirection     = UICollectionViewScrollDirection.Vertical
            };

            // Line Layout
            lineLayout = new LineLayout()
            {
                HeaderReferenceSize = new System.Drawing.SizeF(160, 100),
                ScrollDirection     = UICollectionViewScrollDirection.Horizontal
            };

            // Circle Layout
            circleLayout = new CircleLayout();

//            simpleCollectionViewController = new SimpleCollectionViewController (flowLayout);
            simpleCollectionViewController = new SimpleCollectionViewController(lineLayout);
//            simpleCollectionViewController = new SimpleCollectionViewController (circleLayout);

            simpleCollectionViewController.CollectionView.ContentInset = new UIEdgeInsets(50, 0, 0, 0);

            window.RootViewController = simpleCollectionViewController;
            window.MakeKeyAndVisible();

            return(true);
        }
        private void DecorateControls()
        {
            var flowLayout = new UICollectionViewFlowLayout()
            {
                HeaderReferenceSize = new CGSize(0, 0),
                SectionInset = new UIEdgeInsets(0, 0, 0, 0),
                ScrollDirection = UICollectionViewScrollDirection.Horizontal,
                MinimumInteritemSpacing = 0,
                MinimumLineSpacing = 0
            };

            swipeView.CollectionViewLayout = flowLayout;
            swipeView.PagingEnabled = true;
            swipeView.ShowsHorizontalScrollIndicator = false;
            swipeView.BackgroundColor = UIColor.White;

            swipeView.DataSource = new CollectionViewSource(swipeView);

            var nib = UINib.FromName(ImageCell.Key, null);
            swipeView.RegisterNibForCell(nib, ImageCell.Key);

            swipeView.Delegate = new CollectionViewDelegate(pageControl);

            if (pageControl != null)
            {
                pageControl.CurrentPageIndicatorTintColor = UIColor.Red;
                pageControl.PageIndicatorTintColor = UIColor.White;
                View.BringSubviewToFront(pageControl);
            }
        }
Example #9
0
                #pragma warning restore 414
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            // Flow Layout
            flowLayout = new UICollectionViewFlowLayout()
            {
                HeaderReferenceSize     = new CGSize(100, 100),
                SectionInset            = new UIEdgeInsets(20, 20, 20, 20),
                ScrollDirection         = UICollectionViewScrollDirection.Vertical,
                MinimumInteritemSpacing = 50,           // minimum spacing between cells
                MinimumLineSpacing      = 50            // minimum spacing between rows if ScrollDirection is Vertical or between columns if Horizontal
            };

            // Line Layout
            lineLayout = new LineLayout()
            {
                HeaderReferenceSize = new CGSize(160, 100),
                ScrollDirection     = UICollectionViewScrollDirection.Horizontal
            };

            // Circle Layout
            circleLayout = new CircleLayout();

//            simpleCollectionViewController = new SimpleCollectionViewController (flowLayout);
//            simpleCollectionViewController = new SimpleCollectionViewController (lineLayout);
            simpleCollectionViewController = new SimpleCollectionViewController(circleLayout);

            simpleCollectionViewController.CollectionView.ContentInset = new UIEdgeInsets(50, 0, 0, 0);

            window.RootViewController = simpleCollectionViewController;
            window.MakeKeyAndVisible();

            return(true);
        }
		//
		// This method is invoked when the application has loaded and is ready to run. In this 
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			// use UICollectionViewFlowLayout
			var layout = new UICollectionViewFlowLayout (){
				HeaderReferenceSize = new System.Drawing.SizeF (50, 50),
				SectionInset = new UIEdgeInsets (20,0,0,0)
			};

			// use CircleLayout
//			var layout = new CircleLayout ();

			// use LineLayout
//			var layout = new LineLayout (){
//				HeaderReferenceSize = new System.Drawing.SizeF (250, 50)
//			};
		
			simpleCollectionViewController = new SimpleCollectionViewController (layout);

			window.RootViewController = simpleCollectionViewController;

			// make the window visible
			window.MakeKeyAndVisible ();
			
			return true;
		}
Example #11
0
        private void InitializeUi()
        {
            var layout = new UICollectionViewFlowLayout
            {
                MinimumLineSpacing      = 8,
                MinimumInteritemSpacing = 8,
                ScrollDirection         = UICollectionViewScrollDirection.Vertical,
                SectionInset            = new UIEdgeInsets(
                    0,
                    0,
                    0,
                    0)
            };

            _collectionView = new UICollectionView(CGRect.Empty, layout)
            {
                AlwaysBounceVertical = false,
                TranslatesAutoresizingMaskIntoConstraints = false,
                Delegate = new DTCalendarCollectionViewFlowDelegate()
            };

            _source = new DTCalendarDaysViewSource(_collectionView);

            _collectionView.Source = _source;

            ContentView.AddSubview(_collectionView);
            _collectionView.TopAnchor.ConstraintEqualTo(ContentView.TopAnchor).Active       = true;
            _collectionView.LeftAnchor.ConstraintEqualTo(ContentView.LeftAnchor).Active     = true;
            _collectionView.RightAnchor.ConstraintEqualTo(ContentView.RightAnchor).Active   = true;
            _collectionView.BottomAnchor.ConstraintEqualTo(ContentView.BottomAnchor).Active = true;
        }
        public CGSize GetSizeForItem(UICollectionView collectionView, UICollectionViewLayout layout, NSIndexPath indexPath)
        {
            UICollectionViewFlowLayout layout1 = (UICollectionViewFlowLayout)collectionView.CollectionViewLayout;
            var space = layout1.MinimumInteritemSpacing + layout1.SectionInset.Left + layout1.SectionInset.Right;
            var size  = (collectionView.Frame.Size.Width / 2) - space;

            return(new CGSize(size, size));
        }
Example #13
0
        private UICollectionViewFlowLayout CreateCollectionViewLayout()
        {
            var layout = new UICollectionViewFlowLayout();

            layout.HeaderReferenceSize = new CGSize(CollectionView.Frame.Width, 50);
            CollectionView.SetCollectionViewLayout(layout, false);
            return(layout);
        }
		// This method is invoked when the application has loaded and is ready to run. In this
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			// create and initialize a UICollectionViewFlowLayout
			layout = new UICollectionViewFlowLayout () {

				HeaderReferenceSize = new SizeF (UIScreen.MainScreen.Bounds.Width, 50),
				SectionInset = new UIEdgeInsets (10,5,10,5),

				MinimumInteritemSpacing = 5,
				MinimumLineSpacing = 5,
				ItemSize = new System.Drawing.SizeF (100, 100)
			};

			// create a CollectionViewController (which is a UICollectionViewController) with a layout
			viewController = new CollectionViewController (layout);

			//TODO: Step 4b: uncomment to implement a left swipe gesture to switch between Collection View Layouts

			// toggle the layout in response to a swipe left
//			swipeLeft = new UISwipeGestureRecognizer (g => {
//
//				if (customLayout == null) {
//
//					// create and initialize a CustomLayout
//					customLayout = new CustomLayout (viewController.Speakers.Count){
//						ItemSize = new SizeF (100, 100)
//					};
//				}
//
//				if (viewController.CollectionView.CollectionViewLayout is UICollectionViewFlowLayout) {
//
//					// switch to a custom layout
//					viewController.CollectionView.SetCollectionViewLayout (customLayout, true);
//				} else {
//
//					// invalidate the flow layout in case the orientation changed
//					layout.InvalidateLayout();
//
//					// switch to a flow layout
//					viewController.CollectionView.SetCollectionViewLayout (layout, true);
//
//					// scroll to the top
//					viewController.CollectionView.SetContentOffset(new PointF(0,0), false);
//				}
//			}){
//				Direction = UISwipeGestureRecognizerDirection.Left
//			};
//			// add the gesture recognizer to the UICollectionView
//			viewController.CollectionView.AddGestureRecognizer (swipeLeft);


			window.RootViewController = viewController;
			window.MakeKeyAndVisible ();

			return true;
		}
Example #15
0
        public override void ViewDidLoad()
        {
            try
            {
                TokenUpdate();
                nfloat width = UIScreen.MainScreen.Bounds.Width;
                width = width / 2 - 15;
                UICollectionViewFlowLayout flowLayout;
                flowLayout = new UICollectionViewFlowLayout()
                {
                    ItemSize        = new CGSize(width, 325.0f),
                    SectionInset    = new UIEdgeInsets(10.0f, 10.0f, 10.0f, 10.0f),
                    ScrollDirection = UICollectionViewScrollDirection.Vertical
                };
                if (CurrentUser.GetStore() == 1)
                {
                    //BTProgressHUD.Show("Please wait...");
                    //NavigationController.Title = "Locations";
                    NavigationController.PushViewController(new PhyCollectionView(flowLayout, 1), false);
                }
                else if (CurrentUser.GetStore() == 2)
                {
                    //BTProgressHUD.Show("Please wait...");
                    //NavigationController.Title = "Locations";
                    NavigationController.PushViewController(new PhyCollectionView(flowLayout, 2), false);
                }
                else if (CurrentUser.GetStore() == 3)
                {
                    NavigationController.PushViewController(new PhyCollectionView(flowLayout, 3), false);
                }
            }
            catch (Exception ex)
            {
                LoggingClass.LogError(ex.Message + " User not allowed to send notifications.", screen, ex.StackTrace);
            }
            nfloat ScreenHeight = UIScreen.MainScreen.Bounds.Height;

            ScreenHeight = (ScreenHeight - 100) / 3;
            nfloat   margin = 1;
            nfloat   start  = 50;
            UIButton btnMan = new UIButton();
            UIButton btnSec = new UIButton();
            UIButton btnPP  = new UIButton();

            btnMan.Frame = new CGRect(0, start, UIScreen.MainScreen.Bounds.Width, ScreenHeight);
            btnPP.Frame  = new CGRect(0, start + ScreenHeight + margin, UIScreen.MainScreen.Bounds.Width, ScreenHeight);
            btnSec.Frame = new CGRect(0, start + (ScreenHeight + margin) * 2, UIScreen.MainScreen.Bounds.Width, ScreenHeight);
            btnMan.SetTitle("", UIControlState.Normal);
            btnSec.SetTitle("", UIControlState.Normal);
            btnPP.SetTitle("", UIControlState.Normal);
            btnMan.SetBackgroundImage(new UIImage("Images/wall1.jpg"), UIControlState.Normal);
            btnSec.SetBackgroundImage(new UIImage("Images/scacus1.jpg"), UIControlState.Normal);
            btnPP.SetBackgroundImage(new UIImage("Images/pp1.jpg"), UIControlState.Normal);
            View.AddSubview(btnMan);
            View.AddSubview(btnSec);
            View.AddSubview(btnPP);
            BindClicks(btnMan, btnSec, btnPP, View);
        }
Example #16
0
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            // create and initialize a UICollectionViewFlowLayout
            layout = new UICollectionViewFlowLayout()
            {
                HeaderReferenceSize = new SizeF(UIScreen.MainScreen.Bounds.Width, 50),
                SectionInset        = new UIEdgeInsets(10, 5, 10, 5),

                MinimumInteritemSpacing = 5,
                MinimumLineSpacing      = 5,
                ItemSize = new System.Drawing.SizeF(100, 100)
            };

            // create a CollectionViewController (which is a UICollectionViewController) with a layout
            viewController = new CollectionViewController(layout);

            //TODO: Step 4b: uncomment to implement a left swipe gesture to switch between Collection View Layouts

            // toggle the layout in response to a swipe left
//			swipeLeft = new UISwipeGestureRecognizer (g => {
//
//				if (customLayout == null) {
//
//					// create and initialize a CustomLayout
//					customLayout = new CustomLayout (viewController.Speakers.Count){
//						ItemSize = new SizeF (100, 100)
//					};
//				}
//
//				if (viewController.CollectionView.CollectionViewLayout is UICollectionViewFlowLayout) {
//
//					// switch to a custom layout
//					viewController.CollectionView.SetCollectionViewLayout (customLayout, true);
//				} else {
//
//					// invalidate the flow layout in case the orientation changed
//					layout.InvalidateLayout();
//
//					// switch to a flow layout
//					viewController.CollectionView.SetCollectionViewLayout (layout, true);
//
//					// scroll to the top
//					viewController.CollectionView.SetContentOffset(new PointF(0,0), false);
//				}
//			}){
//				Direction = UISwipeGestureRecognizerDirection.Left
//			};
//			// add the gesture recognizer to the UICollectionView
//			viewController.CollectionView.AddGestureRecognizer (swipeLeft);


            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            return(true);
        }
		// This method is invoked when the application has loaded and is ready to run. In this 
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			// create and initialize a UICollectionViewFlowLayout
			flowLayout = new UICollectionViewFlowLayout (){
				SectionInset = new UIEdgeInsets (25,5,10,5),
				MinimumInteritemSpacing = 5,
				MinimumLineSpacing = 5,
				ItemSize = new CGSize (100, 100)
			};

			circleLayout = new CircleLayout (Monkeys.Instance.Count){
				ItemSize = new CGSize (100, 100)
			};
		
			imagesController = new ImagesCollectionViewController (flowLayout);

			nfloat sf = 0.4f;
			UICollectionViewTransitionLayout trLayout = null;
			UICollectionViewLayout nextLayout;

			pinch = new UIPinchGestureRecognizer (g => {

				var progress = Math.Abs(1.0f -  g.Scale)/sf;

				if(trLayout == null){
					if(imagesController.CollectionView.CollectionViewLayout is CircleLayout)
						nextLayout = flowLayout;
					else
						nextLayout = circleLayout;

					trLayout = imagesController.CollectionView.StartInteractiveTransition (nextLayout, (completed, finished) => {	
						Console.WriteLine ("transition completed");
						trLayout = null;
					});
				}

				trLayout.TransitionProgress = (nfloat)progress;

				imagesController.CollectionView.CollectionViewLayout.InvalidateLayout ();

				if(g.State == UIGestureRecognizerState.Ended){
					if (trLayout.TransitionProgress > 0.5f)
						imagesController.CollectionView.FinishInteractiveTransition ();
					else
						imagesController.CollectionView.CancelInteractiveTransition ();
				}

			});

			imagesController.CollectionView.AddGestureRecognizer (pinch);

			window.RootViewController = imagesController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
Example #18
0
        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            FixKeyboard();
            var Layout = new UICollectionViewFlowLayout();
            var w      = CalcCellWidth(CollectionView.Bounds.Width);

            Layout.ItemSize = new SizeF(w, 50);
            CollectionView.SetCollectionViewLayout(Layout, true);
        }
Example #19
0
        public CarouselViewLoopManager(UICollectionViewFlowLayout layout)
        {
            if (layout == null)
            {
                throw new ArgumentNullException(nameof(layout), "LoopManager expects a UICollectionViewFlowLayout");
            }

            _layout = layout;
        }
Example #20
0
        public void FitCollectionSize()
        {
            UICollectionViewFlowLayout flowLayout = new UICollectionViewFlowLayout();

            flowLayout.MinimumLineSpacing = 10;
            flowLayout.ItemSize           = new SizeF(90, 90);
            viewGrid.CollectionViewLayout = flowLayout;

            this.LayoutIfNeeded();
        }
Example #21
0
        void FlowLayoutSelected(object sender, EventArgs e)
        {
            UICollectionViewFlowLayout layout = new UICollectionViewFlowLayout();

            layout.ItemSize                = new CGSize((this.listView.Bounds.Size.Width - 3) / 3.0, this.listView.Bounds.Size.Height / 4.0);
            layout.HeaderReferenceSize     = new CGSize(100, 30);
            layout.MinimumInteritemSpacing = 1;
            layout.MinimumLineSpacing      = 1;
            this.listView.Layout           = layout;
            this.SetSelectedOptionInSection(1, 1);
        }
		public override UICollectionViewController NextViewControllerAtPoint (PointF p)
		{
			UICollectionViewFlowLayout grid = new UICollectionViewFlowLayout () {
				ItemSize = new SizeF (75.0f, 75.0f),
				SectionInset = new UIEdgeInsets (10.0f, 10.0f, 10.0f, 10.0f)
			};
			return new APLGridCollectionViewController (grid) {
				Title = "Grid Layout",
				UseLayoutToLayoutNavigationTransitions = true
			};
		}
Example #23
0
 public AnimatedTextField(CGRect frame) : base(frame)
 {
     this.layout         = new UICollectionViewFlowLayout();
     this.fontSize       = 36;
     this.collectionView = new UICollectionView(this.Bounds, this.layout);
     this.collectionView.RegisterClassForCell(typeof(LOTCharacterCell), ReuseIdentifier);
     this.collectionView.Delegate        = this;
     this.collectionView.DataSource      = this;
     this.collectionView.BackgroundColor = UIColor.White;
     this.AddSubview(this.collectionView);
 }
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            Window.MakeKeyAndVisible();

            var layout         = new UICollectionViewFlowLayout();
            var viewController = new ViewController(layout);

            Window.RootViewController = new UINavigationController(viewController);
            return(true);
        }
Example #25
0
 void FlowLayoutSelected()
 {
     UICollectionViewFlowLayout layout = new UICollectionViewFlowLayout();
     layout.ItemSize = new CGSize((this.listView.Bounds.Size.Width-3)/3.0, this.listView.Bounds.Size.Height/4.0);
     layout.HeaderReferenceSize = new CGSize(100, 30);
     layout.MinimumInteritemSpacing = 1;
     layout.MinimumLineSpacing = 1;
     this.listView.Layout = layout;
     this.scrollDirection = TKListViewScrollDirection.Vertical;
     this.SetSelectedOption (1, 1);
 }
        void SetLayout(bool isPortrait)
        {
            var layout = new UICollectionViewFlowLayout
            {
                MinimumInteritemSpacing = 5.0f,
                MinimumLineSpacing      = 5.0f,
                SectionInset            = new UIEdgeInsets(5, 5, 5, 5),
                ItemSize = isPortrait ? PodcastCell.PortraitSize : PodcastCell.LandscapeSize
            };

            CollectionView.SetCollectionViewLayout(layout, false);
        }
        private void SetupCollectionView()
        {
            var collectionViewFlowLayout = new UICollectionViewFlowLayout();

            collectionViewFlowLayout.ScrollDirection = UICollectionViewScrollDirection.Horizontal;
            collectionViewFlowLayout.ItemSize        = new CoreGraphics.CGSize(44, 44);

            collectionView.CollectionViewLayout = collectionViewFlowLayout;

            collectionViewSource  = new CollectionViewSource(collectionView);
            collectionView.Source = collectionViewSource;
        }
Example #28
0
 public CarouselCollectionView(CGRect frame)
     : base(frame, new UICollectionViewFlowLayout()
 {
     ScrollDirection = UICollectionViewScrollDirection.Horizontal
 })
 {
     RegisterClassForCell(typeof(CarouselCell), nameof(CarouselCell));
     _layout          = (UICollectionViewFlowLayout)CollectionViewLayout;
     ScrollEnabled    = true;
     DecelerationRate = DecelerationRateFast;
     ShowsHorizontalScrollIndicator = false;
 }
Example #29
0
        void FlowLayoutSelected()
        {
            UICollectionViewFlowLayout layout = new UICollectionViewFlowLayout();

            layout.ItemSize                = new CGSize((this.listView.Bounds.Size.Width - 3) / 3.0, this.listView.Bounds.Size.Height / 4.0);
            layout.HeaderReferenceSize     = new CGSize(100, 30);
            layout.MinimumInteritemSpacing = 1;
            layout.MinimumLineSpacing      = 1;
            this.listView.Layout           = layout;
            this.scrollDirection           = TKListViewScrollDirection.Vertical;
            this.SetSelectedOption(1, 1);
        }
Example #30
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            flowLayout     = new UICollectionViewFlowLayout();
            viewController = new BingImageGridViewController(flowLayout);

            window.RootViewController = viewController;
            window.MakeKeyAndVisible();

            return(true);
        }
Example #31
0
        public override bool FinishedLaunching (UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            flowLayout = new UICollectionViewFlowLayout ();
            viewController = new BingImageGridViewController (flowLayout);

            window.RootViewController = viewController;
            window.MakeKeyAndVisible ();
            
            return true;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.Orange;
            Title = "My Custom View Controller";
            nfloat h = 31.0f;
            nfloat w = View.Bounds.Width;
            var btn = UIButton.FromType(UIButtonType.System);
            btn.BackgroundColor = UIColor.White;
            btn.Layer.CornerRadius = 5f;
            btn.Frame = new CGRect(10, 200, w - 20, 44);
            btn.SetTitle("Click Me", UIControlState.Normal);

            var user = new SecondViewController();
            //user.View.BackgroundColor = UIColor.Magenta;

            var flowLayout = new UICollectionViewFlowLayout()
            {
                ItemSize = new CGSize(UIScreen.MainScreen.Bounds.Width / 4, (UIScreen.MainScreen.Bounds.Width * 1.5) / 4),
                //HeaderReferenceSize = new CGSize(UIScreen.MainScreen.Bounds.Width, 100),
                SectionInset = new UIEdgeInsets(0, 0, 0, 0),
                ScrollDirection = UICollectionViewScrollDirection.Vertical,
                MinimumInteritemSpacing = 0, // minimum spacing between cells
                MinimumLineSpacing = 0 // minimum spacing between rows if ScrollDirection is Vertical or between columns if Horizontal
            };

            var simpleCollectionViewController = new SimpleCollectionViewController(flowLayout);
            //            simpleCollectionViewController = new SimpleCollectionViewController (lineLayout);
            //            simpleCollectionViewController = new SimpleCollectionViewController (circleLayout);

            //simpleCollectionViewController.CollectionView.ContentInset = new UIEdgeInsets(50, 0, 0, 0);



            btn.TouchUpInside += (sender, e) => {
                this.NavigationController.PushViewController(simpleCollectionViewController, true);
            };

            

            var usernameField = new UITextField
            {
                Placeholder = "Enter your username",
                BorderStyle = UITextBorderStyle.RoundedRect,
                Frame = new CGRect(10, 82, w - 20, h)
            };

            usernameField.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            btn.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            View.AddSubviews(btn, usernameField);

        }
Example #33
0
        public virtual UIView GetView(UICollectionViewCell value)
        {
            var layout         = new UICollectionViewFlowLayout();
            var bounds         = UIScreen.MainScreen.Bounds;
            var collectionView = new UICollectionView(
                bounds,
                layout);

            layout.ItemSize = new CGSize(bounds.Width / 3, bounds.Width / 4);
            collectionView.RegisterClassForCell(typeof(HostCell), "C");
            collectionView.DataSource = new SingleCollectionViewCellDataSource(value);
            return(collectionView);
        }
Example #34
0
 void Init()
 {
     CollectionView.PagingEnabled = true;
     CollectionView.RegisterClassForCell(typeof(CurrentSongCollectionViewCell), CurrentSongCollectionViewCell.Key);
     CollectionView.CollectionViewLayout = layout = new UICollectionViewFlowLayout
     {
         ScrollDirection         = UICollectionViewScrollDirection.Horizontal,
         MinimumInteritemSpacing = 0,
         MinimumLineSpacing      = 0,
         ItemSize = new CGSize(100, 100),
     };
     CollectionView.ScrollsToTop = false;
 }
Example #35
0
        void AddSection(int y, string url)
        {
            var layout = new UICollectionViewFlowLayout {
                EstimatedItemSize = new CGSize(100, 150),
                ScrollDirection   = UICollectionViewScrollDirection.Horizontal
            };

            var collection = new MovieExplorerViewController(layout, url);

            AddChildViewController(collection);
            collection.View.Frame = new CGRect(10, y, 580, 98);
            View.AddSubview(collection.View);
        }
        public override UICollectionViewController NextViewControllerAtPoint(CGPoint p)
        {
            UICollectionViewFlowLayout grid = new UICollectionViewFlowLayout()
            {
                ItemSize     = new CGSize(75.0f, 75.0f),
                SectionInset = new UIEdgeInsets(10.0f, 10.0f, 10.0f, 10.0f)
            };

            return(new APLGridCollectionViewController(grid)
            {
                Title = "Grid Layout",
                UseLayoutToLayoutNavigationTransitions = true
            });
        }
Example #37
0
        public FAViewController(UICollectionViewFlowLayout layout, FAViewSize size)
            : base(layout)
        {
            _fasize = size;

            _datasource = FA.Empty.Values();
            _searchresult = _datasource;
            _searchbar = new UISearchBar ();
            _searchbar.SearchBarStyle = UISearchBarStyle.Prominent;
            _pinchrecognizer = new UIPinchGestureRecognizer (PinchDetected);

            var searchdelegate = new UISearchFADelegate(this, _searchbar);
            _searchbar.Delegate = searchdelegate;
        }
        private void InitializeUI()
        {
            EdgesForExtendedLayout = UIRectEdge.None;
            View.BackgroundColor   = UIColor.FromRGB(40, 40, 40);

            var container = new UIView
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            Add(container);
            container.LeftAnchor.ConstraintEqualTo(View.LeftAnchor).Active     = true;
            container.TopAnchor.ConstraintEqualTo(View.TopAnchor).Active       = true;
            container.RightAnchor.ConstraintEqualTo(View.RightAnchor).Active   = true;
            container.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active = true;

            var infoLabel = new UILabel
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Text      = "This is a sample View with UICollectionView",
                TextColor = UIColor.FromRGB(245, 241, 230)
            };

            container.Add(infoLabel);
            infoLabel.CenterXAnchor.ConstraintEqualTo(View.CenterXAnchor).Active = true;
            infoLabel.TopAnchor.ConstraintEqualTo(View.TopAnchor, 16).Active     = true;
            infoLabel.HeightAnchor.ConstraintEqualTo(50).Active = true;

            var flowLayout = new UICollectionViewFlowLayout
            {
                ItemSize                = new CGSize(View.Frame.Width, 100),
                ScrollDirection         = UICollectionViewScrollDirection.Vertical,
                MinimumInteritemSpacing = 4,
                MinimumLineSpacing      = 4,
                HeaderReferenceSize     = new CGSize(View.Frame.Width, 50),
                SectionInset            = new UIEdgeInsets(4, 0, 4, 0)
            };

            booksCollectionView = new SampleCollectionView(flowLayout)
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.Clear
            };

            container.Add(booksCollectionView);
            booksCollectionView.LeftAnchor.ConstraintEqualTo(View.LeftAnchor, 8).Active       = true;
            booksCollectionView.TopAnchor.ConstraintEqualTo(infoLabel.BottomAnchor, 8).Active = true;
            booksCollectionView.RightAnchor.ConstraintEqualTo(View.RightAnchor, -8).Active    = true;
            booksCollectionView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active      = true;
        }
        public SplitViewContoller()
            : base()
        {
            splitDelegate = new SplitDelegate ();
            Delegate = splitDelegate;

            masterController = new MasterController ();

            flowLayout = new UICollectionViewFlowLayout (){
                HeaderReferenceSize = new SizeF (UIScreen.MainScreen.Bounds.Width, 50),
                SectionInset = new UIEdgeInsets (20,20,20,20),
                ItemSize = new SizeF (100, 100)
            };

            baseballLayout = new BaseballLayout (){
                ItemSize = new SizeF (100, 100)
            };

            decoratedFlowLayout = new DecoratedFlowLayout () {
                HeaderReferenceSize = new SizeF (UIScreen.MainScreen.Bounds.Width, 50),
                SectionInset = new UIEdgeInsets (25,100,25,100),
                MinimumInteritemSpacing = 5,
                MinimumLineSpacing = 5,
                ItemSize = new System.Drawing.SizeF (100, 100)
            };

            layoutController = new BaseballPlayerController (flowLayout);

            masterController.LayoutSelected += (object sender, LayoutSelectedEventArgs e) => {

                if (e.LayoutName == "Flow Layout") {

                    layoutController.CollectionView.SetCollectionViewLayout (flowLayout, true);
                    layoutController.CollectionView.SetContentOffset(new System.Drawing.PointF(0,0), false);

                } else if (e.LayoutName == "Baseball Layout") {

                    layoutController.CollectionView.SetCollectionViewLayout (baseballLayout, true);
                } else if (e.LayoutName == "Decorated Layout") {

                    layoutController.CollectionView.SetCollectionViewLayout (decoratedFlowLayout, true);
                    layoutController.CollectionView.SetContentOffset(new PointF(0,0), false);
                }
            };

            ViewControllers = new UIViewController[] {
                masterController,
                layoutController
            };
        }
        public ListNativeTest()
        {
            var flowLayout = new UICollectionViewFlowLayout()
            {
                ItemSize = new CGSize((float)UIScreen.MainScreen.Bounds.Size.Width - 20.0f, 50.0f),
            };
            var uICollectionView = new CGRect(0, 0, (int)UIScreen.MainScreen.Bounds.Size.Width, (int)UIScreen.MainScreen.Bounds.Size.Height);

            Waterfall            = new WaterfallCollectionView(uICollectionView, flowLayout);
            Waterfall.DataSource = new WaterfallCollectionSource(Waterfall);
            Waterfall.Delegate   = new WaterfallCollectionDelegate(Waterfall);

            AddSubview(Waterfall);
        }
Example #41
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            xls = new XlsFile(true);
            if (File.Exists(FileName))
            {
                xls.Open(FileName);
            }
            else
            {
                CreateInitialFile(xls);
            }

            CollectionView.RegisterClassForCell(typeof(CalcCell), CalcCellId);
            FixKeyboard();

            var Layout = new UICollectionViewFlowLayout();
            var w      = CalcCellWidth(CollectionView.Bounds.Width);

            Layout.ItemSize = new SizeF(w, 50);
            CollectionView.SetCollectionViewLayout(Layout, false);

            //register the keyboard so we make the text fields visible
            NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.DidShowNotification, (x) =>
            {
                if (ActiveEdit == null)
                {
                    return;
                }
                var keybRectObj = x.UserInfo.ObjectForKey(UIKeyboard.FrameBeginUserInfoKey);
                keybRect        = ((NSValue)keybRectObj).RectangleFValue;
                FixKeyboard();


                var FrameRec     = View.Frame;
                FrameRec.Height -= keybRect.Height;
                if (!FrameRec.Contains(ActiveEdit.Frame.Location))
                {
                    this.CollectionView.ScrollRectToVisible(ActiveEdit.Frame, true);
                }
            });

            NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.DidHideNotification, (x) =>
            {
                keybRect = new RectangleF(0, 0, 0, 0);
                FixKeyboard();
            });
        }
Example #42
0
		//
		// This method is invoked when the application has loaded and is ready to run. In this 
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			layout = new UICollectionViewFlowLayout (){
				SectionInset = new UIEdgeInsets (10,10,10,10)
			};
			
			viewController = new MemoryDemoViewController (layout);
		
			window.RootViewController = viewController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
		/* Create a collection view with a flow layout. Set up the cell, and assign it to
		 * our base CollectionView property.
		  */
		public override void LoadView ()
		{
			var layout = new UICollectionViewFlowLayout ();
			layout.MinimumInteritemSpacing = 20;
			layout.ItemSize = new CGSize (200.0f, 290.0f);

			var collectionView = new UICollectionView (UIScreen.MainScreen.ApplicationFrame, layout);

			collectionView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
			collectionView.BackgroundColor = UIColor.White;

			var nib = UINib.FromName (cellName, null);
			collectionView.RegisterNibForCell (nib, cellName);

			CollectionView = collectionView;
		}
Example #44
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            layout = new UICollectionViewFlowLayout {
                ItemSize = new SizeF(100,100)
            };

            photosController = new PhotosViewController (layout);

            navController = new UINavigationController (photosController);

            window.RootViewController = navController;

            window.MakeKeyAndVisible ();

            return true;
        }
Example #45
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            _window = new UIWindow (UIScreen.MainScreen.Bounds);

            _flowLayout = new UICollectionViewFlowLayout (){
                HeaderReferenceSize = new System.Drawing.SizeF (100, 55),
                ScrollDirection = UICollectionViewScrollDirection.Vertical,
                MinimumInteritemSpacing = -4,
                MinimumLineSpacing = 0
            };

            _gameGridView = new GameGridView (_flowLayout);
            _gameGridView.CollectionView.ContentInset = new UIEdgeInsets (30, 5, 5, 5);

            _window.RootViewController = _gameGridView;
            _window.MakeKeyAndVisible ();

            return true;
        }
		// This method is invoked when the application has loaded and is ready to run. In this
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);


			// TODO: Step 1a: create and initialize a UICollectionViewFlowLayout
			layout = new UICollectionViewFlowLayout () {
				SectionInset = new UIEdgeInsets (20, 5, 10, 5),
				MinimumInteritemSpacing = 5,
				MinimumLineSpacing = 5,
				ItemSize = new System.Drawing.SizeF (100, 100)
			};

			// create a CollectionViewController (which is a UICollectionViewController) with a layout
			window.RootViewController = new CollectionViewController (layout);

			window.MakeKeyAndVisible ();

			return true;
		}
        public SplitViewContoller () : base()
        {
            sd = new SplitDelegate ();
            Delegate = sd;

            animalsController = new AnimalsController ();
            layout = new UICollectionViewFlowLayout (){
                SectionInset = new UIEdgeInsets (20,20,20,20)
            };

            animalImageController = new BingImageGridViewController (layout);

            animalsController.AnimalSelected+= (sender, e) => {
                animalImageController.LoadImages (e.Animal);
            };

            ViewControllers = new UIViewController[] {
                animalsController,
                animalImageController
            };
        }
		// This method is invoked when the application has loaded and is ready to run. In this 
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			// create and initialize a UICollectionViewFlowLayout
			layout = new UICollectionViewFlowLayout (){
				SectionInset = new UIEdgeInsets (10,5,10,5),
				MinimumInteritemSpacing = 5,
				MinimumLineSpacing = 5,
				ItemSize = new CGSize (100, 100)
			};

			viewController = new ImagesCollectionViewController (layout);
			viewController.UseLayoutToLayoutNavigationTransitions = false;

			navController = new UINavigationController (viewController);

			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            gridLayout = new UICollectionViewFlowLayout {
                SectionInset = new UIEdgeInsets(20, 20, 20, 20),
                ScrollDirection = UICollectionViewScrollDirection.Horizontal,
                ItemSize = new SizeF(125, 60),
                MinimumLineSpacing = 20.0f,
                MinimumInteritemSpacing = 20.0f // top and bottom padding
            };

            collectionView = new UICollectionView(View.Frame, gridLayout);

            collectionView.RegisterClassForCell(typeof(CollectionViewCell), cellId);

            collectionView.DataSource = new CollectionViewDataSource();

            collectionView.ScrollEnabled = false;

            collectionView.ContentInset = new UIEdgeInsets(100, 0, 140, 0);

            View.AddSubview(collectionView);
        }
		// This method is invoked when the application has loaded and is ready to run. In this
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			// create and initialize a UICollectionViewFlowLayout
			layout = new UICollectionViewFlowLayout () {

				//TODO: Step 2d: uncomment the next 2 lines to adjust for adding "header" Supplementary View
//				HeaderReferenceSize = new SizeF (UIScreen.MainScreen.Bounds.Width, 50),
//				SectionInset = new UIEdgeInsets (10,5,10,5),

				MinimumInteritemSpacing = 5,
				MinimumLineSpacing = 5,
				ItemSize = new System.Drawing.SizeF (100, 100)
			};

			// create a CollectionViewController (which is a UICollectionViewController) with a layout
			viewController = new CollectionViewController (layout);

			window.RootViewController = viewController;
			window.MakeKeyAndVisible ();

			return true;
		}
        async Task RefreshUI()
        {
            NavigationController.NavigationBar.TopItem.Title = viewModel.FirstName;
            NavigationController.Title = viewModel.FirstName;

            lblBeersCount.Text = viewModel.BeerCount;
            lblRatingCount.Text = viewModel.RatingsCount;
            lblPhotoCount.Text = viewModel.PhotoCount;

            var layout = new UICollectionViewFlowLayout();   
            layout.SectionInset = new UIEdgeInsets(5, 5, 2.5f, 2.5f);
            RefreshAvatar();

            return;
         }
Example #52
0
 void FlowLayoutSelected(object sender, EventArgs e)
 {
     UICollectionViewFlowLayout layout = new UICollectionViewFlowLayout();
     layout.ItemSize = new CGSize((this.listView.Bounds.Size.Width-3)/3.0, this.listView.Bounds.Size.Height/4.0);
     layout.HeaderReferenceSize = new CGSize(100, 30);
     layout.MinimumInteritemSpacing = 1;
     layout.MinimumLineSpacing = 1;
     this.listView.Layout = layout;
     this.SetSelectedOptionInSection (1, 1);
 }
		private static UICollectionViewFlowLayout CollectionViewFlowLayoutForOrientation (UIInterfaceOrientation orientation, GMImagePickerController picker)
		{
			nfloat screenWidth;
			nfloat screenHeight;

			//Ipad popover is not affected by rotation!
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
				screenWidth = picker.View.Bounds.Width;
				screenHeight = picker.View.Bounds.Height;
			} else {
				if (UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeLeft ||
					UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeRight) {
					screenHeight = picker.View.Bounds.Width;
					screenWidth = picker.View.Bounds.Height;
				} else {
					screenWidth = picker.View.Bounds.Width;
					screenHeight = picker.View.Bounds.Height;
				}
			}

			if ((UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) ||
				(UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.Portrait ||
					UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.PortraitUpsideDown))
			{
				if (_portraitLayout == null) {
					var cellTotalUsableWidth = screenWidth - (picker.ColsInPortrait - 1) * picker.MinimumInteritemSpacing;
					var itemSize = new CGSize (cellTotalUsableWidth / picker.ColsInPortrait, cellTotalUsableWidth / picker.ColsInPortrait);
					var cellTotalUsedWidth = (double)itemSize.Width * picker.ColsInPortrait;
					var spaceTotalWidth = (double)screenWidth - cellTotalUsedWidth;
					var spaceWidth = spaceTotalWidth / (picker.ColsInPortrait - 1);

					_portraitLayout = new UICollectionViewFlowLayout {
						MinimumInteritemSpacing = picker.MinimumInteritemSpacing,
						ItemSize = itemSize,
						MinimumLineSpacing = (nfloat) spaceWidth
					};
				}
				return _portraitLayout;
			} else {
				if (_landscapeLayout == null) {
					var cellTotalUsableWidth = screenHeight - (picker.ColsInLandscape - 1) * picker.MinimumInteritemSpacing;
					var itemSize = new CGSize (cellTotalUsableWidth / picker.ColsInLandscape, cellTotalUsableWidth / picker.ColsInLandscape);
					var cellTotalUsedWidth = (double)itemSize.Width * picker.ColsInLandscape;
					var spaceTotalWidth = (double)screenHeight - cellTotalUsedWidth;
					var spaceWidth = spaceTotalWidth / (picker.ColsInLandscape - 1);
					_landscapeLayout = new UICollectionViewFlowLayout {
						MinimumInteritemSpacing = picker.MinimumInteritemSpacing,
						ItemSize = itemSize,
						MinimumLineSpacing = (nfloat) spaceWidth
					};
				}
				return _landscapeLayout;
			}
		}
		public LineLayoutViewController (UICollectionViewFlowLayout layout) : base (layout)
		{			
		}
        public CustomFlyoutNavigationController()
        {
            var dvc = new HomeViewController ();

            navScheduleController = new MonoTouch.UIKit.UINavigationController();
            navScheduleController.PushViewController(dvc, false);
            navScheduleController.NavigationBar.BarStyle = UIBarStyle.Black;
            //			navScheduleController.TopViewController.Title ="What's on";
            //			navScheduleController.TabBarItem = new UITabBarItem("What's on", UIImage.FromFile("Images/83-calendar.png"), 0);

            if (UIDevice.CurrentDevice.CheckSystemVersion (6,0)) {
                // iOS 6 and above support CollectionView
                var layout = new UICollectionViewFlowLayout (){
                    SectionInset = new UIEdgeInsets (0,0,0,0),
                    ItemSize = SpeakerCollectionCell.Size,
                    MinimumInteritemSpacing = 10,
                    MinimumLineSpacing = 5
                };
                var svc = new SpeakersCollectionViewController (layout); // COLLECTION
                navSpeakerController = new MonoTouch.UIKit.UINavigationController();
                navSpeakerController.PushViewController(svc, false);
                navSpeakerController.TopViewController.View.BackgroundColor = new UIColor(65.0f,169.0f,198.0f,255.0f);
                navSpeakerController.NavigationBar.BarStyle = UIBarStyle.Black;
                navSpeakerController.TopViewController.Title ="Speakers";
            } else {
                // use a table
                var svc = new SpeakersViewController(); // TABLE
                navSpeakerController = new MonoTouch.UIKit.UINavigationController();
                navSpeakerController.PushViewController (svc, false);
                navSpeakerController.NavigationBar.BarStyle = UIBarStyle.Black;
            }

            var ssvc = new TagsViewController();
            navSessionController = new MonoTouch.UIKit.UINavigationController();
            navSessionController.PushViewController(ssvc, false);
            navSessionController.NavigationBar.BarStyle = UIBarStyle.Black;
            //			navSessionController.TopViewController.Title ="Sessions";
            //			navSessionController.TabBarItem = new UITabBarItem("Sessions", UIImage.FromFile("Images/124-bullhorn.png"), 2);

            var mapViewController = new MapFlipViewController();
            mapViewController.View.BackgroundColor = UIColor.Black;

            var fvc = new FavoritesViewController();
            navFavoritesController = new MonoTouch.UIKit.UINavigationController();
            navFavoritesController.PushViewController(fvc, false);

            //			var passbookViewController = new PassKitViewController ();

            var aboutViewController = new AboutViewController ();

            //var roomsViewController = new RoomsViewController ();

            // Create the navigation menu
            NavigationRoot = new RootElement ("Navigation") {
                new Section () {
                    new StyledStringElement ("MonkeySpace 2013"){BackgroundColor = UIColor.Clear, TextColor = UIColor.White, Font = AppDelegate.Current.FontFlyoutMenuSection},
                    new StyledStringElement ("Sessions"){BackgroundColor = UIColor.Clear, TextColor = UIColor.LightGray, Font = AppDelegate.Current.FontFlyoutMenu},
                    new StyledStringElement ("Speakers"){BackgroundColor = UIColor.Clear, TextColor = UIColor.LightGray, Font = AppDelegate.Current.FontFlyoutMenu},
                    new StyledStringElement ("Favorites"){BackgroundColor = UIColor.Clear, TextColor = UIColor.LightGray, Font = AppDelegate.Current.FontFlyoutMenu},
                    //new StyledStringElement ("Room Plan"){BackgroundColor = UIColor.Clear, TextColor = UIColor.LightGray, Font = AppDelegate.Current.FontFlyoutMenu},
                    new StyledStringElement ("Location Map"){BackgroundColor = UIColor.Clear, TextColor = UIColor.LightGray, Font = AppDelegate.Current.FontFlyoutMenu},
                    //new StyledStringElement ("Passbook"){BackgroundColor = UIColor.Clear, TextColor = UIColor.LightGray, Font = AppDelegate.Current.FontFlyoutMenu},
                    new StyledStringElement ("About MonkeySpace"){BackgroundColor = UIColor.Clear, TextColor = UIColor.LightGray, Font = AppDelegate.Current.FontFlyoutMenu},
                }
            };
            // Supply view controllers corresponding to menu items:
            ViewControllers = new UIViewController[] {
                navScheduleController
                , navSessionController
                , navSpeakerController
                , navFavoritesController
                //, roomsViewController
                , mapViewController
                //, passbookViewController
                , aboutViewController
            };
            if (MonoTouch.PassKit.PKPassLibrary.IsAvailable) {
                //TODO: only add the passkit screen if necessary
            }

            View.BackgroundColor = UIColor.Blue;
        }
Example #56
0
        /// <summary>
        /// Create the ViewControllers that we are going to use for the tabs:
        /// Sessions, Speakers
        /// </summary>
        /// <remarks>
        /// Some icons from glyphish.com -- CCA so DON'T FORGET attribution on the website!!
        /// </remarks>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            var dvc = new HomeViewController ();

            navScheduleController = new MonoTouch.UIKit.UINavigationController();
            navScheduleController.PushViewController(dvc, false);
            navScheduleController.NavigationBar.BarStyle = UIBarStyle.Black;
            navScheduleController.TopViewController.Title ="What's on";
            navScheduleController.TabBarItem = new UITabBarItem("What's on", UIImage.FromFile("Images/83-calendar.png"), 0);

            var svc = new SpeakersViewController();
            navSpeakerController = new MonoTouch.UIKit.UINavigationController();
            navSpeakerController.PushViewController(svc, false);
            navSpeakerController.TopViewController.View.BackgroundColor = new UIColor(65.0f,169.0f,198.0f,255.0f);
            navSpeakerController.NavigationBar.BarStyle = UIBarStyle.Black;
            navSpeakerController.TopViewController.Title ="Speakers";
            navSpeakerController.TabBarItem = new UITabBarItem("Speakers", UIImage.FromFile("Images/tabspeaker.png"), 1);

            var ssvc = new TagsViewController();
            navSessionController = new MonoTouch.UIKit.UINavigationController();
            navSessionController.PushViewController(ssvc, false);
            navSessionController.NavigationBar.BarStyle = UIBarStyle.Black;
            navSessionController.TopViewController.Title ="Sessions";
            navSessionController.TabBarItem = new UITabBarItem("Sessions", UIImage.FromFile("Images/124-bullhorn.png"), 2);

            var mvc = new MapFlipViewController();
            mvc.Title = "Map";
            mvc.TabBarItem = new UITabBarItem("Map", UIImage.FromFile("Images/103-map.png"), 5);

            var fvc = new FavoritesViewController();
            navFavoritesController = new MonoTouch.UIKit.UINavigationController();
            navFavoritesController.PushViewController(fvc, false);
            navFavoritesController.NavigationBar.BarStyle = UIBarStyle.Black;
            navFavoritesController.TopViewController.Title ="My Schedule";
            navFavoritesController.TabBarItem = new UITabBarItem("My Schedule", UIImage.FromFile("Images/28-star.png"), 7);

            var flowLayout = new UICollectionViewFlowLayout();
            flowLayout.HeaderReferenceSize = new System.Drawing.SizeF(300f, 70f);
            var fvc2 = new PhotosCollectionViewController (flowLayout);
            navCollectionViewController = new MonoTouch.UIKit.UINavigationController();
            navCollectionViewController.PushViewController(fvc2, false);
            navCollectionViewController.NavigationBar.BarStyle = UIBarStyle.Black;
            navCollectionViewController.TopViewController.Title ="MonkeySpace Photos";
            navCollectionViewController.TabBarItem = new UITabBarItem("MonkeySpace Photos", UIImage.FromFile("Images/28-star.png"), 7);

            var u = new UIViewController[]
            {
                  navScheduleController
                , navSpeakerController
                , navSessionController
                , mvc
                , navFavoritesController
                , navCollectionViewController
            };

            SelectedIndex = 0;
            ViewControllers = u;
            MoreNavigationController.NavigationBar.BarStyle = UIBarStyle.Black;

            var backgroundColor = UIColor.FromPatternImage(UIImage.FromFile("Background.png"));
            MoreNavigationController.View.BackgroundColor = backgroundColor;

            CustomizableViewControllers = new UIViewController[]{};
        }
Example #57
0
    void SetLayout(bool isPortrait)
    {
      var layout = new UICollectionViewFlowLayout
      {
        MinimumInteritemSpacing = 5.0f,
        MinimumLineSpacing = 5.0f,
        SectionInset = new UIEdgeInsets(5, 5, 5, 5),
        ItemSize = isPortrait ? PodcastCell.PortraitSize : PodcastCell.LandscapeSize
      };

      CollectionView.SetCollectionViewLayout(layout, false);
    }
Example #58
0
		public virtual UIView GetView (UICollectionViewCell value)
		{
			var layout = new UICollectionViewFlowLayout ();
			var bounds = UIScreen.MainScreen.Bounds;
			var collectionView = new UICollectionView (
				                     bounds,
				                     layout);
			layout.ItemSize = new CGSize (bounds.Width / 3, bounds.Width / 4);
			collectionView.RegisterClassForCell (typeof (HostCell), "C");
			collectionView.DataSource = new SingleCollectionViewCellDataSource (value);
			return collectionView;
		}
Example #59
0
        private HomeViewController CreateHomeController()
        {
            //			var layout = new CollectionViewWaterfallLayout
            //			{
            //				SectionInset = new UIEdgeInsets (10, 10, 10, 10),
            //				MinimumColumnSpacing = 10,
            //				MinimumInteritemSpacing = 10
            //			};

            var layout = new UICollectionViewFlowLayout
            {
                MinimumInteritemSpacing = 10.0f,
                MinimumLineSpacing = 10.0f,
                SectionInset = new UIEdgeInsets(10, 10, 10, 10),
                ItemSize = new SizeF(160, 160)
            };
            var controller = new HomeViewController(layout);
            return controller;
        }
Example #60
0
        void useCollectionView(object sender, EventArgs args)
        {
            if (this.View.Subviews.Length > 0) {
                this.View.Subviews [0].RemoveFromSuperview ();
            }

            this.dataSource.Settings.CollectionView.CreateCell ((UICollectionView collectionView, NSIndexPath indexPath, NSObject item) => {
                return (UICollectionViewCell) collectionView.DequeueReusableCell("cell", indexPath);
            });

            this.dataSource.Settings.CollectionView.InitCell ((UICollectionView collectionView, NSIndexPath indexPath, UICollectionViewCell cell, NSObject item) => {
                DSCollectionViewCell dscell = (DSCollectionViewCell)cell;
                DSItem dsitem = (DSItem)item;
                dscell.Label.Text = this.dataSource.TextFromItem(item, null);
                dscell.ImageView.Image = dsitem.Image;
            });

            UICollectionViewFlowLayout layout = new UICollectionViewFlowLayout ();
            layout.ItemSize = new CGSize (140, 140);

            UICollectionView collection = new UICollectionView (this.View.Bounds, layout);
            collection.RegisterClassForCell (typeof(DSCollectionViewCell), "cell");
            collection.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            collection.DataSource = this.dataSource;
            collection.BackgroundColor = UIColor.White;
            this.View.AddSubview (collection);
        }