public UIPageViewControllerSpineLocation GetSpineLocation (UIPageViewController pageViewController, UIInterfaceOrientation orientation)
		{
			if (orientation == UIInterfaceOrientation.Portrait || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				UIViewController currentViewController = pageViewController.ViewControllers [0];
				pageViewController.SetViewControllers (
					new [] { currentViewController },
					UIPageViewControllerNavigationDirection.Forward,
					true, null
				);

				pageViewController.DoubleSided = false;
				return UIPageViewControllerSpineLocation.Min;
			}

			var dataViewController = (DataViewController)pageViewController.ViewControllers [0];
			var indexOfCurrentViewController = modelController.IndexOfViewController (dataViewController);
			UIViewController[] viewControllers = null;

			if (indexOfCurrentViewController == 0 || indexOfCurrentViewController % 2 == 0) {
				UIViewController nextViewController = modelController.GetNextViewController (pageViewController, dataViewController);
				viewControllers = new [] { dataViewController, nextViewController };
			} else {
				UIViewController previousViewController = modelController.GetPreviousViewController (pageViewController, dataViewController);
				viewControllers = new[] { dataViewController, previousViewController };
			}

			pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);
			return UIPageViewControllerSpineLocation.Mid;
		}
Ejemplo n.º 2
1
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = Theme.PrimaryNavigationBarColor;

            var welcomeViewController = new WelcomeViewController();
            welcomeViewController.WantsToDimiss += OnWantsToDismiss;

            var pages = new UIViewController[]
            { 
                new CardPageViewController(new AboutViewController()),
                new CardPageViewController(new PromoteView()),
                new CardPageViewController(new GoProViewController()),
                new CardPageViewController(new FeedbackViewController()),
                new CardPageViewController(welcomeViewController),
            };

            var welcomePageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal);
            welcomePageViewController.DataSource = new PageDataSource(pages);
            welcomePageViewController.SetViewControllers(new [] { pages[0] }, UIPageViewControllerNavigationDirection.Forward, true, null);
            welcomePageViewController.View.Frame = new CoreGraphics.CGRect(0, 0, View.Frame.Width, View.Frame.Height);
            welcomePageViewController.View.AutoresizingMask = UIViewAutoresizing.All;
            AddChildViewController(welcomePageViewController);
            Add(welcomePageViewController.View);

            var nextButton = new UIButton(UIButtonType.Custom);
            nextButton.SetTitle("Next", UIControlState.Normal);
            nextButton.TintColor = UIColor.White;
            nextButton.TitleLabel.Font = UIFont.SystemFontOfSize(14f);
            nextButton.Frame = new CoreGraphics.CGRect(View.Frame.Width - 50f, View.Frame.Height - 28f, 40f, 20f);
            nextButton.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleTopMargin;
            Add(nextButton);

            var transitionAction = new Action<UIViewController>(e => {
                var isLast = pages.Last() == e;
                //nextButton.Enabled = !isLast;
                UIView.Transition(nextButton, 0.25f, UIViewAnimationOptions.TransitionCrossDissolve, 
                    () => nextButton.SetTitle(isLast ? "Done" : "Next", UIControlState.Normal), null);
            });

            welcomePageViewController.WillTransition += (sender, e) => transitionAction(e.PendingViewControllers[0]);

            nextButton.TouchUpInside += (sender, e) => {
                var currentViewController = welcomePageViewController.ViewControllers[0];
                var nextViewController = welcomePageViewController.DataSource.GetNextViewController(welcomePageViewController, currentViewController);
                if (nextViewController != null)
                {
                    transitionAction(nextViewController);
                    welcomePageViewController.SetViewControllers(new [] { nextViewController }, UIPageViewControllerNavigationDirection.Forward, true, null);
                }
                else
                {
                    OnWantsToDismiss();
                }
            };
        }
Ejemplo n.º 3
1
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view
            pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);

            pageViewController.View.Frame = this.View.Bounds;
            this.View.AddSubview(pageViewController.View);

            courseManager = new CourseManager(Courses.Lib.Category.Android);
            courseManager.MoveFirst();

            //CourseViewController firstCourseViewController = CreateCoursesViewController();

            //pageViewController.GetNextViewController = GetNextViewController;
            //pageViewController.GetPreviousViewController = GetPreviousViewController;

            CoursePagerViewControllerDataSource dataSource = new CoursePagerViewControllerDataSource(courseManager);
            pageViewController.DataSource = dataSource;

            CourseViewController firstCourseViewController = dataSource.GetFirstViewController();

            pageViewController.SetViewControllers(new UIViewController[] { firstCourseViewController }, UIPageViewControllerNavigationDirection.Forward, false, null);
        }
Ejemplo n.º 4
1
        /// <summary>
        /// Handles loading the view. Override to perform any additional setup after loading the view.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Handles the spacing between the pages.
            var values = new NSObject[] { NSNumber.FromFloat(4.0f) };
            var keys = new NSObject[] { new NSString("UIPageViewControllerOptionInterPageSpacingKey") };
            var options = NSDictionary.FromObjectsAndKeys(values, keys);

            var controllers = new List<UIViewController>()
            {
                new ParallaxItemViewController(new Flower() {ImagePath = "Images/Samples/Daffodils.jpg", Title="Daffodils", Subtitle="Narcissus"}),
                new ParallaxItemViewController(new Flower() {ImagePath = "Images/Samples/Orchids.jpg", Title="Orchids", Subtitle="Orchidaceae"}),
                new ParallaxItemViewController(new Flower() {ImagePath = "Images/Samples/Roses.jpg", Title="Roses", Subtitle="Rosa"})
            };

            // Init our pageviewer.
            pageController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, options);
            pageController.SetViewControllers(new UIViewController[] { controllers[0] }, UIPageViewControllerNavigationDirection.Forward, false, null);
            pageController.View.Frame = this.View.Bounds;
            pageController.DataSource = new PagingDataSource(controllers);

            // Hooks up the scrollview so we can parallax it.
            SetupParallax();

            // Add the controls to the view.
            this.Add(this.pageController.View);

            // Create an offset - this is for debugging purposes only.
            debugOffset = new UILabel() { Frame = new RectangleF(10, 100, 300, 50), Text = "Offset = ", Font = Theme.FontOfSize(14f), TextColor = UIColor.White };
            this.Add(debugOffset);
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			modelController = new ModelController ();

			pageViewController = new UIPageViewController (
				UIPageViewControllerTransitionStyle.PageCurl,
				UIPageViewControllerNavigationOrientation.Horizontal,
				new NSDictionary ()
			);

			pageViewController.Delegate = this;
			DataViewController startingViewController = modelController.GetViewController (0, Storyboard);
			pageViewController.SetViewControllers (
				new [] { startingViewController },
				UIPageViewControllerNavigationDirection.Forward,
				false, null
			);

			pageViewController.DataSource = modelController;
			AddChildViewController (pageViewController);
			View.AddSubview (pageViewController.View);

			CGRect pageViewRect = View.Bounds;

			pageViewController.View.Frame = pageViewRect;
			pageViewController.DidMoveToParentViewController (this);
			View.GestureRecognizers = pageViewController.GestureRecognizers;
		}
 public override void ViewDidLoad()
 {
     base.ViewDidLoad ();
     Paginacion PrimeraP = new Paginacion(0);
     ControladorVistas = new UIPageViewController
         (UIPageViewControllerTransitionStyle.PageCurl,
          UIPageViewControllerNavigationOrientation.Horizontal,
          UIPageViewControllerSpineLocation.Min);
     ControladorVistas.SetViewControllers
         (new UIViewController[]{PrimeraP},
         UIPageViewControllerNavigationDirection.Forward,
         false, s => { });
     ControladorVistas.GetNextViewController = this.SiguientePagina;
     ControladorVistas.GetPreviousViewController = this.PaginaPrevia;
     ControladorVistas.View.Frame = this.View.Bounds;
     this.View.AddSubview (this.ControladorVistas.View);
 }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			pageViewController = ChildViewControllers [0] as UIPageViewController;
			if (pageViewController == null)
				return;

			var startingViewController = DataSource.GetViewControllerAt (0);
			if (startingViewController == null)
				return;

			DataViewController[] viewControllers = { startingViewController };
			pageViewController.SetViewControllers (viewControllers, Forward, false, null);


			pageViewController.DataSource = DataSource;
			pageViewController.DidMoveToParentViewController (this);
		}
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			viewController = new UIPageViewController (UIPageViewControllerTransitionStyle.Scroll,
				UIPageViewControllerNavigationOrientation.Horizontal,
				UIPageViewControllerSpineLocation.None, 20f);

			// kick things off by making the first page
			ImageViewController pageZero = ImageViewController.ImageViewControllerForPageIndex (0);
			viewController.SetViewControllers (new UIViewController[] { pageZero },
				UIPageViewControllerNavigationDirection.Forward,
				false, null);
			viewController.DataSource = new MyDataSource ();
			window.RootViewController = viewController;
			// make the window visible
			window.MakeKeyAndVisible ();

			return true;
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			_pageTitles = new List<string> {"Explore", "Widget", "Navigation", "Random"};
			_images = new List<string> {"page1", "page2", "page3", "page4"};

			pageViewController = this.Storyboard.InstantiateViewController ("PageViewController") as UIPageViewController;
			pageViewController.DataSource = new PageViewControllerDataSource (this, _pageTitles);

			var startVC = this.ViewControllerAtIndex (0) as ContentViewController;
			var viewControllers = new UIViewController[] {startVC};

			pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null);
			pageViewController.View.Frame = new CGRect (0, 0, this.View.Frame.Width, this.View.Frame.Size.Height-50); 
			AddChildViewController (this.pageViewController);
			View.AddSubview (this.pageViewController.View);
			pageViewController.DidMoveToParentViewController (this);

			button.TouchUpInside += RestartTutorial;
		}
        public UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation)
        {
            UIViewController currentViewController;
            UIViewController[] viewControllers;

            if (orientation == UIInterfaceOrientation.Portrait || orientation == UIInterfaceOrientation.PortraitUpsideDown || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
                // In portrait orientation or on iPhone: Set the spine position to "min" and the page view controller's view controllers array to contain just one view controller.
                // Setting the spine position to 'UIPageViewControllerSpineLocation.Mid' in landscape orientation sets the doubleSided property to true, so set it to false here.
                currentViewController = pageViewController.ViewControllers [0];
                viewControllers = new [] { currentViewController };
                pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);

                pageViewController.DoubleSided = false;

                return UIPageViewControllerSpineLocation.Min;
            }

            // In landscape orientation: Set set the spine location to "mid" and the page view controller's view controllers array to contain two view controllers.
            // If the current page is even, set it to contain the current and next view controllers; if it is odd, set the array to contain the previous and current view controllers.
            currentViewController = pageViewController.ViewControllers [0];

            int index = ModelController.IndexOf ((DataViewController)currentViewController);
            if (index == 0 || index % 2 == 0) {
                var nextViewController = ModelController.GetNextViewController (pageViewController, currentViewController);
                viewControllers = new [] { currentViewController, nextViewController };
            } else {
                var previousViewController = ModelController.GetPreviousViewController (pageViewController, currentViewController);
                viewControllers = new [] { previousViewController, currentViewController };
            }

            pageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);

            return UIPageViewControllerSpineLocation.Mid;
        }
        public UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation)
        {
            UIViewController currentViewController;

            UIViewController[] viewControllers;

            if (orientation == UIInterfaceOrientation.Portrait || orientation == UIInterfaceOrientation.PortraitUpsideDown || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                // In portrait orientation or on iPhone: Set the spine position to "min" and the page view controller's view controllers array to contain just one view controller.
                // Setting the spine position to 'UIPageViewControllerSpineLocation.Mid' in landscape orientation sets the doubleSided property to true, so set it to false here.
                currentViewController = pageViewController.ViewControllers[0];
                viewControllers       = new[] { currentViewController };
                pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);

                pageViewController.DoubleSided = false;

                return(UIPageViewControllerSpineLocation.Min);
            }

            // In landscape orientation: Set set the spine location to "mid" and the page view controller's view controllers array to contain two view controllers.
            // If the current page is even, set it to contain the current and next view controllers; if it is odd, set the array to contain the previous and current view controllers.
            currentViewController = pageViewController.ViewControllers[0];

            int index = ModelController.IndexOf((IAdLayoutInterface)currentViewController);


            var nextViewController = ModelController.GetNextViewController(pageViewController, currentViewController);

            viewControllers = new[] { currentViewController, nextViewController };


            pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);

            return(UIPageViewControllerSpineLocation.Mid);
        }
Ejemplo n.º 12
0
        public UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation)
        {
            if (orientation == UIInterfaceOrientation.Portrait || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                UIViewController currentViewController = pageViewController.ViewControllers [0];
                pageViewController.SetViewControllers(
                    new [] { currentViewController },
                    UIPageViewControllerNavigationDirection.Forward,
                    true, null
                    );

                pageViewController.DoubleSided = false;
                return(UIPageViewControllerSpineLocation.Min);
            }

            var dataViewController           = (DataViewController)pageViewController.ViewControllers [0];
            var indexOfCurrentViewController = modelController.IndexOfViewController(dataViewController);

            UIViewController[] viewControllers = null;

            if (indexOfCurrentViewController == 0 || indexOfCurrentViewController % 2 == 0)
            {
                UIViewController nextViewController = modelController.GetNextViewController(pageViewController, dataViewController);
                viewControllers = new [] { dataViewController, nextViewController };
            }
            else
            {
                UIViewController previousViewController = modelController.GetPreviousViewController(pageViewController, dataViewController);
                viewControllers = new[] { dataViewController, previousViewController };
            }

            pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);
            return(UIPageViewControllerSpineLocation.Mid);
        }
Ejemplo n.º 13
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     pageViewController.SetViewControllers(new UIViewController[] { config.ViewControllers.First() }, UIPageViewControllerNavigationDirection.Forward, true, null);
     AddChildViewController(pageViewController);
     View.AddSubviews(tabs, pageViewController.View, indicator);
     indicator.BackgroundColor = config.ActiveColor;
     tabs.BringSubviewToFront(indicator);
     DidMoveToParentViewController(this);
 }
        public void NextPage()
        {
            PointsBaseViewController current = pageViewController.ViewControllers[0] as PointsBaseViewController;

            var next = pageViewController.DataSource.GetNextViewController(pageViewController, current);

            var viewControllers = new UIViewController[] { next };

            pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);
            next.View.LayoutSubviews();
        }
Ejemplo n.º 15
0
        public void SetSelectedPage(int pageIndex)
        {
            RewardsBaseViewController current = pageViewController.ViewControllers[0] as RewardsBaseViewController;
            var model = pageSource.SetSelectedPage(pageIndex, pageViewController, current);

            pageSource.SelectedIndex = -1;
            if (model == null)
            {
                return;
            }
            var viewControllers = new UIViewController[] { model.Controller };

            pageViewController.SetViewControllers(viewControllers, model.Direction, true, null);
        }
        public void NextPage()
        {
            IntroBaseViewController current = pageViewController.ViewControllers[0] as IntroBaseViewController;
            var next            = dataSource.GetNextViewController(pageViewController, current);
            var viewControllers = new UIViewController[] { next };

            ChangeProgressViewValue(dataSource.NextIndex);
            if (next == null && dataSource.CurrentIndex > 0)
            {
                //LoginCommand();
                return;
            }
            pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);
        }
Ejemplo n.º 17
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = Theme.PrimaryNavigationBarColor;

            var pages = GetPages().Select(x => new CardPageViewController(x)).ToArray();
            var welcomePageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal);

            welcomePageViewController.DataSource = new PageDataSource(pages);
            welcomePageViewController.SetViewControllers(new [] { pages[0] }, UIPageViewControllerNavigationDirection.Forward, true, null);
            welcomePageViewController.View.Frame            = new CoreGraphics.CGRect(0, 0, View.Frame.Width, View.Frame.Height);
            welcomePageViewController.View.AutoresizingMask = UIViewAutoresizing.All;
            AddChildViewController(welcomePageViewController);
            Add(welcomePageViewController.View);

            var nextButton = new UIButton(UIButtonType.Custom);

            nextButton.SetTitle("Next", UIControlState.Normal);
            nextButton.TintColor        = UIColor.White;
            nextButton.TitleLabel.Font  = UIFont.SystemFontOfSize(14f);
            nextButton.Frame            = new CoreGraphics.CGRect(View.Frame.Width - 50f, View.Frame.Height - 28f, 40f, 20f);
            nextButton.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleTopMargin;
            Add(nextButton);

            var transitionAction = new Action <UIViewController>(e => {
                var isLast = pages.Last() == e;
                //nextButton.Enabled = !isLast;
                UIView.Transition(nextButton, 0.25f, UIViewAnimationOptions.TransitionCrossDissolve,
                                  () => nextButton.SetTitle(isLast ? "Done" : "Next", UIControlState.Normal), null);
            });

            welcomePageViewController.WillTransition += (sender, e) => transitionAction(e.PendingViewControllers[0]);

            nextButton.TouchUpInside += (sender, e) => {
                var currentViewController = welcomePageViewController.ViewControllers[0];
                var nextViewController    = welcomePageViewController.DataSource.GetNextViewController(welcomePageViewController, currentViewController);
                if (nextViewController != null)
                {
                    transitionAction(nextViewController);
                    welcomePageViewController.SetViewControllers(new [] { nextViewController }, UIPageViewControllerNavigationDirection.Forward, true, null);
                }
                else
                {
                    OnWantsToDismiss();
                }
            };
        }
Ejemplo n.º 18
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _pageTitles = new List <string> {
                "Explore", "Widget", "Navigation", "Random"
            };
            _images = new List <string> {
                "page1", "page2", "page3", "page4"
            };

            pageViewController            = this.Storyboard.InstantiateViewController("PageViewController") as UIPageViewController;
            pageViewController.DataSource = new PageViewControllerDataSource(this, _pageTitles);

            var startVC         = this.ViewControllerAtIndex(0) as ContentViewController;
            var viewControllers = new UIViewController[] { startVC };

            pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null);
            pageViewController.View.Frame = new CGRect(0, 0, this.View.Frame.Width, this.View.Frame.Size.Height - 50);
            AddChildViewController(this.pageViewController);
            View.AddSubview(this.pageViewController.View);
            pageViewController.DidMoveToParentViewController(this);

            button.TouchUpInside += RestartTutorial;
        }
Ejemplo n.º 19
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view
            pageViewController = new UIPageViewController(
                UIPageViewControllerTransitionStyle.Scroll,
                UIPageViewControllerNavigationOrientation.Horizontal);

            pageViewController.View.Frame = View.Bounds;
            View.AddSubviews(pageViewController.View);

            _courseManager = new CourseManager();
            _courseManager.MoveFirst();

            CourseViewController firstCourseViewController = CreateCourseViewController();

            pageViewController.SetViewControllers(new UIViewController[]
            {
                firstCourseViewController
            }, UIPageViewControllerNavigationDirection.Forward, false, null);

            pageViewController.GetNextViewController     = GetNextViewController;
            pageViewController.GetPreviousViewController = GetPreviousViewController;
        }
Ejemplo n.º 20
0
 public void SetViewControllers()
 {
     pvc = new UIPageViewController();
     // note: Complete is called synchronously
     pvc.SetViewControllers(pvc.ViewControllers, UIPageViewControllerNavigationDirection.Forward, false, Complete);
     Assert.Null(pvc, "pvc");
 }
Ejemplo n.º 21
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SetupView();

            _signUpButton.TouchUpInside -= OnSignUpButton_TouchUpInside;
            _signUpButton.TouchUpInside += OnSignUpButton_TouchUpInside;

            _signInButton.TouchUpInside -= OnSignInButton_TouchUpInside;
            _signInButton.TouchUpInside += OnSignInButton_TouchUpInside;

            _pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal);

            var viewControllers = new List <XBoardPageViewController>
            {
                new BoardPageViewController(0, ViewModel.WelcomeTitle, ViewModel.WelcomeSubtitle, "letter_logo"),
                new BoardPageViewController(1, ViewModel.RegisterTitle, ViewModel.RegisterSubtitle, "board_mail"),
                new BoardPageViewController(2, ViewModel.CallTitle, ViewModel.CallSubtitle, "board_chat")
            };

            var onBoardPageSource = new PageSource(viewControllers);

            _pageViewController.DataSource = onBoardPageSource;
            _pageViewController.SetViewControllers(new UIViewController[] { viewControllers.FirstOrDefault() }, UIPageViewControllerNavigationDirection.Forward, false, null);

            this.AddChildViewController(_pageViewController);
            _pageContainer.AddSubview(_pageViewController.View);

            _pageViewController.DidFinishAnimating -= DidTransition;
            _pageViewController.DidFinishAnimating += DidTransition;

            _pageControl.CurrentPage = 0;
        }
Ejemplo n.º 22
0
 void ButtonSkip_TouchUpInside(object sender, EventArgs e)
 {
     if (IsTutoFinished)
     {
         if (!App.Locator.Login.GetSavedFirstLaunchTuto())
         {
             App.Locator.Login.SaveFirstLaunchTuto();
             App.Locator.ListSeekios.GoToSeekios();
         }
         else
         {
             GoBack(true);
         }
     }
     else
     {
         if (CurrentPage < 3)
         {
             CurrentPage++;
             var startVC         = ViewControllerAtIndex(CurrentPage) as TutorialForegroundView;
             var viewControllers = new UIViewController[] { startVC };
             _pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);
             UpdateSkipButton();
         }
     }
 }
Ejemplo n.º 23
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            modelController = new ModelController();

            pageViewController = new UIPageViewController(
                UIPageViewControllerTransitionStyle.PageCurl,
                UIPageViewControllerNavigationOrientation.Horizontal,
                new NSDictionary()
                );

            pageViewController.Delegate = this;
            DataViewController startingViewController = modelController.GetViewController(0, Storyboard);

            pageViewController.SetViewControllers(
                new [] { startingViewController },
                UIPageViewControllerNavigationDirection.Forward,
                false, null
                );

            pageViewController.DataSource = modelController;
            AddChildViewController(pageViewController);
            View.AddSubview(pageViewController.View);

            CGRect pageViewRect = View.Bounds;

            pageViewController.View.Frame = pageViewRect;
            pageViewController.DidMoveToParentViewController(this);
            View.GestureRecognizers = pageViewController.GestureRecognizers;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SeparatelyShouldRefreshEndpoints = new List <bool> {
                true, true, true
            };

            PointsAndStatsButton.SetTitle("Points & Stats");
            LeaderboardButton.SetTitle("Leaderboard");
            TransactionsButton.SetTitle("Transactions");
            PointsAndStatsButton.SetSelected();

            UIStoryboard board = UIStoryboard.FromName("Main", null);

            pageViewController = board.InstantiateViewController("PointsPageViewController") as UIPageViewController;
            pageSource         = new PointsPageViewControllerDataSource(this);

            pageViewController.DataSource = pageSource;

            var startVC         = this.ViewControllerAtIndex(1) as PointsBaseViewController; //start on second page for glitch (should start on page index 0 without glitch)
            var viewControllers = new UIViewController[] { startVC };

            pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null);
            pageViewController.View.Frame = mainView.Bounds;
            AddChildViewController(this.pageViewController);
            mainView.AddSubview(this.pageViewController.View);
            pageViewController.DidMoveToParentViewController(this);

            CGRect frame = View.Frame;
        }
        void InsertPage(object item, int position)
        {
            if (pageController != null && Source != null)
            {
                Source.Insert(position, item);

                var firstViewController = CreateViewController(Element.Position);

                pageController.SetViewControllers(new[] { firstViewController }, UIPageViewControllerNavigationDirection.Forward, false, s =>
                {
                    SetIndicators();

                    Element.PositionSelected?.Invoke(Element, EventArgs.Empty);
                });
            }
        }
Ejemplo n.º 26
0
        public virtual void OpenDocumentPage(int pageNumber)
        {
            if (pageNumber < 1 || pageNumber > PDFDocument.PageCount)
            {
                return;
            }

            var navDirection = pageNumber < PDFDocument.CurrentPageNumber
                                ? UIPageViewControllerNavigationDirection.Reverse
                                : UIPageViewControllerNavigationDirection.Forward;

            var pageVC = getPageViewController(pageNumber);

            if (pageVC == null)
            {
                return;
            }

            _bookPageViewController.SetViewControllers(
                new UIViewController [] { pageVC },
                navDirection,
                true,
                s => {
                execActionsAfterOpenPage();
            });
        }
Ejemplo n.º 27
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _pageTitles = new List <string> {
                "WELCOME", "DATA", "VOUCHERS"
            };
            _images = new List <string> {
                "Onboard-Portrait1.jpg", "Onboard-Portrait2.jpg", "Onboard-Portrait3.jpg"
            };

            pageViewController            = this.Storyboard.InstantiateViewController("PageViewController") as UIPageViewController;
            pageViewController.DataSource = new PageViewControllerDataSource(this, _pageTitles);

            var startVC         = this.ViewControllerAtIndex(0) as ContentViewController;
            var viewControllers = new UIViewController[] { startVC };

            pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null);
            pageViewController.View.Frame = new CGRect(0, 0, this.View.Frame.Width, this.View.Frame.Size.Height);
            AddChildViewController(this.pageViewController);
            View.AddSubview(this.pageViewController.View);
            pageViewController.DidMoveToParentViewController(this);

            //button.TouchUpInside += RestartTutorial;
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Configure the page view controller and add it as a child view controller.
			PageViewController = new UIPageViewController (UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);
			PageViewController.WeakDelegate = this;

			var startingViewController = ModelController.GetViewController (0, Storyboard);
			var viewControllers = new UIViewController[] { startingViewController };
			PageViewController.SetViewControllers (viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null);

			PageViewController.WeakDataSource = ModelController;

			AddChildViewController (PageViewController);
			View.AddSubview (PageViewController.View);

			// Set the page view controller's bounds using an inset rect so that self's view is visible around the edges of the pages.
			var pageViewRect = View.Bounds;
			pageViewRect = new RectangleF (pageViewRect.X + 20, pageViewRect.Y + 20, pageViewRect.Width - 40, pageViewRect.Height - 40);
			PageViewController.View.Frame = pageViewRect;

			PageViewController.DidMoveToParentViewController (this);

			// Add the page view controller's gesture recognizers to the book view controller's view so that the gestures are started more easily.
			View.GestureRecognizers = PageViewController.GestureRecognizers;
		}
Ejemplo n.º 29
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ModelController = new ModelController();

            // Configure the page view controller and add it as a child view controller.
            PageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);
            PageViewController.WeakDelegate = this;

            var startingViewController = ModelController.GetViewController(0, Storyboard);
            var viewControllers        = new UIViewController[] { startingViewController };

            PageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null);

            PageViewController.WeakDataSource = ModelController;

            AddChildViewController(PageViewController);
            View.AddSubview(PageViewController.View);

            // Set the page view controller's bounds using an inset rect so that self's view is visible around the edges of the pages.
            var pageViewRect = View.Bounds;

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                pageViewRect = new CGRect(pageViewRect.X + 20, pageViewRect.Y + 20, pageViewRect.Width - 40, pageViewRect.Height - 40);
            }
            PageViewController.View.Frame = pageViewRect;

            PageViewController.DidMoveToParentViewController(this);

            // Add the page view controller's gesture recognizers to the book view controller's view so that the gestures are started more easily.
            View.GestureRecognizers = PageViewController.GestureRecognizers;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // create a UIPageViewController that pages horizontally (min puts the spine on the left
            pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);

            // size the view controller so it fills the containing View (context is this.View.Bounds)
            pageViewController.View.Frame = View.Bounds;

            // place the pageViewController inside the UIViewController
            View.AddSubview(pageViewController.View);

            courseManager = new CourseManager(categoryTitle);
            courseManager.MoveFirst();

            CoursePagerViewControllerDataSource dataSource = new CoursePagerViewControllerDataSource(courseManager);
            pageViewController.DataSource = dataSource;

            // Create an instance of the CourseViewController for the current course of the CourseManager
            CourseViewController firstCourseViewController = dataSource.GetFirstViewController();

            pageViewController.SetViewControllers(new UIViewController[] { firstCourseViewController }, UIPageViewControllerNavigationDirection.Forward, false, null);

            // assign delegate methods
            //pageViewController.GetNextViewController = GetNextViewController;
            //pageViewController.GetPreviousViewController = GetPreviousViewController;
        }
Ejemplo n.º 31
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Title = Application.LocalizedString("GeneralHelp");
            if (!App.Locator.Login.GetSavedFirstLaunchTuto())
            {
                NavigationController.NavigationBarHidden = true;
            }

            _pageTitles = new List <string> {
                Application.LocalizedString("IMEIAndPinHelp")
                , Application.LocalizedString("CreditsHelp")
                , Application.LocalizedString("FirstUseHelp")
            };
            _images = new List <string> {
                "TutoAddSeekios", "TutoCredits", "TutoMode"
            };

            _pageViewController            = Storyboard.InstantiateViewController("PageViewController") as UIPageViewController;
            _pageViewController.DataSource = new TutorialBackgroundSource(this, _pageTitles);

            var startVC         = ViewControllerAtIndex(0) as TutorialForegroundView;
            var viewControllers = new UIViewController[] { startVC };

            _pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);
            _pageViewController.View.Frame = new CGRect(0, 0, View.Frame.Width, View.Frame.Size.Height - 42);
            AddChildViewController(_pageViewController);
            View.AddSubview(_pageViewController.View);
            _pageViewController.DidMoveToParentViewController(this);
            _pageViewController.WillTransition += PageViewController_WillTransition;

            ButtonSkip.TouchUpInside += ButtonSkip_TouchUpInside;
            ButtonSkip.SetTitle(Application.LocalizedString("SkipButton"), UIControlState.Normal);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);

            pageViewController.View.Frame = this.View.Bounds;
            this.View.AddSubview(pageViewController.View);

            courseManager = new CourseManager();
            courseManager.MoveFirst();
            var dataSource = new CoursePagerViewControllerDataSource(courseManager);

            pageViewController.DataSource = dataSource;

            CourseViewController myFirstCourseViewController = dataSource.GetFirstViewController();

            pageViewController.SetViewControllers(new UIViewController[] { myFirstCourseViewController }, UIPageViewControllerNavigationDirection.Forward, false, null);



            //pageViewController.GetNextViewController = GetNextViewController;
            //pageViewController.GetPreviousViewController = GetPreviousViewController;
        }
Ejemplo n.º 33
0
        /// <summary>
        /// Gets the spine location.
        /// </summary>
        /// <param name='pageController'>The book PageView controller.</param>
        /// <param name='orientation'>The device orientation.</param>
        /// <returns>The spine location.</returns>
        private UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation)
        {
            var currentPageVC = _GetCurrentPageVC();

            pageViewController.DoubleSided = false;
            pageViewController.SetViewControllers(new UIViewController[] { currentPageVC }, UIPageViewControllerNavigationDirection.Forward, true, s => { });
            return(UIPageViewControllerSpineLocation.Min);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.AddSubview(TabBar);

            AddChildViewController(pageViewController);
            View.AddSubview(pageViewController.View);
            pageViewController.View.TranslatesAutoresizingMaskIntoConstraints = false;
            pageViewController.DidMoveToParentViewController(this);


            var views = NSDictionary.FromObjectsAndKeys(
                new NSObject[] {
                TabBar,
                pageViewController.View
            },
                new NSObject[] {
                (NSString)"tabbar",
                (NSString)"content"
            }
                );

            View.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|-0-[tabbar]-0-[content]-0-|",
                                                                    0,
                                                                    null,
                                                                    views));
            View.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:|-0-[tabbar]-0-|",
                                                                    0,
                                                                    null,
                                                                    views));
            View.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:|-0-[content]-0-|",
                                                                    0,
                                                                    null,
                                                                    views));


            tabBarHeight = NSLayoutConstraint.Create(
                TabBar,
                NSLayoutAttribute.Height,
                NSLayoutRelation.Equal,
                1, 68
                );
            TabBar.AddConstraint(tabBarHeight);

            if (pageViewController.ViewControllers.Length == 0 &&
                lastSelectedIndex >= 0 && lastSelectedIndex < ViewControllers.Count)
            {
                pageViewController.SetViewControllers(
                    new[] { ViewControllers[lastSelectedIndex] },
                    UIPageViewControllerNavigationDirection.Forward,
                    true, null
                    );
            }

            UpdateSwipe(Tabbed.SwipeEnabled);
            pageViewController.DidFinishAnimating += HandlePageViewControllerDidFinishAnimating;
        }
Ejemplo n.º 35
0
        void forwardButtonPressed(UIButton sender)
        {
            currentIndex += 1;
            currentIndex  = currentIndex % dataSource.NumberOfFlags;

            var viewController = dataSource.GetViewControllerAt(currentIndex);

            pageViewController.SetViewControllers(new UIViewController [] { viewController }, Forward, true, null);
        }
Ejemplo n.º 36
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            const int buttonHeight = 50;

            var pagerSurload = new UIPageControl
            {
                Frame = new CGRect(0, UIScreen.MainScreen.Bounds.Height - buttonHeight - buttonHeight, UIScreen.MainScreen.Bounds.Width, buttonHeight),
                Pages = 4
            };

            var pvController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal);
            var pages        = new List <StartupPageFeatureViewController>();
            int index        = 0;

            pages.Add(new StartupPageFeatureViewController(
                          Core.Resources.StringValues.Startup_FlipViewItem1_Title_Text,
                          Core.Resources.StringValues.Startup_FlipViewItem1_Content_Text,
                          index++));

            pages.Add(new StartupPageFeatureViewController(
                          Core.Resources.StringValues.Startup_FlipViewItem2_Title_Text,
                          Core.Resources.StringValues.Startup_FlipViewItem2_Content_Text,
                          index++));

            pages.Add(new StartupPageFeatureViewController(
                          Core.Resources.StringValues.Startup_FlipViewItem3_Title_Text,
                          Core.Resources.StringValues.Startup_FlipViewItem3_Content_Text,
                          index++));

            pages.Add(new StartupPageFeatureViewController(
                          Core.Resources.StringValues.Startup_FlipViewItem4_Title_Text,
                          Core.Resources.StringValues.Startup_FlipViewItem4_Content_Text,
                          index++));

            pvController.DataSource = new PageDataSource(pages, pagerSurload);
            pvController.View.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height - buttonHeight);
            pvController.SetViewControllers(new UIViewController[] { pages[0], }, UIPageViewControllerNavigationDirection.Forward, false, s => { });

            AddChildViewController(pvController);
            View.AddSubview(pvController.View);
            pvController.DidMoveToParentViewController(this);

            View.AddSubview(pagerSurload);

            var connectButton = new UIButton
            {
                Frame           = new CGRect(0, UIScreen.MainScreen.Bounds.Height - buttonHeight, UIScreen.MainScreen.Bounds.Width, buttonHeight),
                BackgroundColor = ApplicationColors.MainColor
            };

            connectButton.SetTitle(Core.Resources.StringValues.Startup_ConnectionButton_Text, UIControlState.Normal);
            View.AddSubview(connectButton);
            connectButton.SetCommand(ViewModel.GoToNextPageCommand);
        }
Ejemplo n.º 37
0
        public UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation)
        {
            var result = UIPageViewControllerSpineLocation.None;

            if (orientation == UIInterfaceOrientation.Portrait || UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                // In portrait orientation or on iPhone: Set the spine position to "min" and the page view controller's view controllers array to contain just one view controller.
                // Setting the spine position to 'UIPageViewControllerSpineLocationMid' in landscape orientation sets the doubleSided property to YES, so set it to NO here.
                var currentViewController = pageViewController.ViewControllers[0];
                pageViewController.SetViewControllers(new[] { currentViewController },
                                                      UIPageViewControllerNavigationDirection.Forward,
                                                      true,
                                                      null);

                pageViewController.DoubleSided = false;
                result = UIPageViewControllerSpineLocation.Min;
            }
            else
            {
                // In landscape orientation: Set set the spine location to "mid" and the page view controller's view controllers array to contain two view controllers.
                // If the current page is even, set it to contain the current and next view controllers; if it is odd, set the array to contain the previous and current view controllers.
                var dataViewController             = pageViewController.ViewControllers[0] as DataViewController;
                var indexOfCurrentViewController   = modelController.IndexOfViewController(dataViewController);
                UIViewController[] viewControllers = null;

                if (indexOfCurrentViewController == 0 || indexOfCurrentViewController % 2 == 0)
                {
                    var nextViewController = modelController.GetNextViewController(pageViewController, dataViewController);
                    viewControllers = new[] { dataViewController, nextViewController };
                }
                else
                {
                    var previousViewController = modelController.GetPreviousViewController(pageViewController, dataViewController);
                    viewControllers = new[] { dataViewController, previousViewController };
                }

                pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, true, null);
                result = UIPageViewControllerSpineLocation.Mid;
            }

            return(result);
        }
Ejemplo n.º 38
0
        void backButtonPressed(UIButton sender)
        {
            currentIndex -= 1;
            if (currentIndex < 0)
            {
                currentIndex = dataSource.NumberOfFlags - 1;
            }

            var viewController = dataSource.GetViewControllerAt(currentIndex);

            pageViewController?.SetViewControllers(new UIViewController [] { viewController }, Reverse, true, null);
        }
Ejemplo n.º 39
0
        /// <summary>
        /// Calls after the controller’s view did loaded into memory.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Load document
            PDFDocument.OpenDocument(_DocumentName, _DocumentPath);

            // Init View
            Title = _DocumentName;
            View.BackgroundColor = UIColor.ScrollViewTexturedBackgroundColor;
            _AutoScaleMode       = MgrAccessor.OptionsMgr.Options.AutoScaleMode;

            // Create toolbar
            if (MgrAccessor.OptionsMgr.Options.ToolbarVisible)
            {
                _Toolbar = _CreateToolbar();
                View.AddSubview(_Toolbar);
            }

            // Create bottom bar (with slider)
            if (MgrAccessor.OptionsMgr.Options.BottombarVisible)
            {
                _BottomBar = _CreateBottomBar();
                View.AddSubview(_BottomBar);
                // Update Slider Max value
                _UpdateSliderMaxValue();
            }

            // Create the book PageView controller
            _BookPageViewController = new UIPageViewController(
                MgrAccessor.OptionsMgr.Options.PageTransitionStyle,
                MgrAccessor.OptionsMgr.Options.PageNavigationOrientation,
                UIPageViewControllerSpineLocation.Min);
            _BookPageViewController.View.Frame                = _GetBookViewFrameRect();
            _BookPageViewController.View.AutoresizingMask     = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            _BookPageViewController.View.BackgroundColor      = UIColor.GroupTableViewBackgroundColor;
            _BookPageViewController.GetNextViewController     = GetNextPageViewController;
            _BookPageViewController.GetPreviousViewController = GetPreviousPageViewController;
            _BookPageViewController.GetSpineLocation          = GetSpineLocation;
            _BookPageViewController.DidFinishAnimating       += delegate(object sender, UIPageViewFinishedAnimationEventArgs e) {
                PageFinishedAnimation(e.Completed, e.Finished, e.PreviousViewControllers);
            };
            _BookPageViewController.SetViewControllers(
                new UIViewController[] { GetPageViewController(1) },
                UIPageViewControllerNavigationDirection.Forward,
                false,
                s => ExecAfterOpenPageActions());

            AddChildViewController(_BookPageViewController);
            _BookPageViewController.DidMoveToParentViewController(this);
            View.AddSubview(_BookPageViewController.View);
        }
        void InsertPage(object item, int position)
        {
            if (pageController != null && Source != null)
            {
                Source.Insert(position, item);

                UIViewController firstViewController;
                if (pageController.ViewControllers.Count() > 0)
                {
                    firstViewController = pageController.ViewControllers[0];
                }
                else
                {
                    firstViewController = CreateViewController(Element.Position);
                }

                pageController.SetViewControllers(new[] { firstViewController }, UIPageViewControllerNavigationDirection.Forward, false, s =>
                {
                    var prevPos = Element.Position;

                    // To keep the same view visible when inserting in a position <= current (like Android ViewPager)
                    isSwiping = true;
                    if (position <= Element.Position && Source.Count > 1)
                    {
                        Element.Position++;
                        prevPosition = Element.Position;
                    }
                    isSwiping = false;

                    SetIndicators();

                    if (position <= prevPos)
                    {
                        Element.PositionSelected?.Invoke(Element, Element.Position);
                    }
                });
            }
        }
Ejemplo n.º 41
0
        public void initChapterViewController(PageController page)
        {
            if (chapterVC == null)
            {
                //initial chapterVC
                ChapterViewController.pages = secondScroll.pagesController;
                chapterVC                     = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);
                chapterVC.DataSource          = new ChapterViewController.ChapterVCDataSource();
                chapterVC.View.Frame          = Constants.mainFrame;
                chapterVC.DidFinishAnimating += (sender, e) => {
                    if (e.Finished)
                    {
                        if (e.Completed)
                        {
                            foreach (ChapterViewController c in e.PreviousViewControllers)
                            {
                                this.secondScroll.view.AddSubview(c.currentPage.smallImage);
                                c.currentPage.smallImageToPosition(secondScroll, this.currentChapter.pagesStartX);
                                var currentVC = (ChapterViewController)chapterVC.ViewControllers [chapterVC.ViewControllers.Length - 1];
                                currentVC.currentPage.smallImage.Hidden = true;
                                Console.WriteLine("current + " + currentVC.currentPage.pageInfo.chapter + "   prev " + c.currentPage.pageInfo.chapter);
                                if (currentVC.currentPage.pageInfo.chapter != c.currentPage.pageInfo.chapter)
                                {
                                    Console.WriteLine("chapterchanged");
                                    int chapter = currentVC.currentPage.pageInfo.chapter;
                                    this.currentPage    = chapter;
                                    this.currentChapter = this.chaptersController [chapter];
                                    this.drawCurrentChapter();
                                }

                                fixSecondScrollPosition(currentVC.currentPage);
                            }
                        }
                    }
                };
            }

            ChapterViewController contentViewController = new ChapterViewController(page);

            var viewControllers = new List <ChapterViewController>();

            viewControllers.Add(contentViewController);
            chapterVC.SetViewControllers(viewControllers.ToArray(), UIPageViewControllerNavigationDirection.Forward, false, null);

            this.AddChildViewController(this.chapterVC);
            chapterVC.DidMoveToParentViewController(this);
            this.View.AddSubview(chapterVC.View);
            this.chapterScroll.UserInteractionEnabled = false;
            this.secondScroll.UserInteractionEnabled  = false;
        }
Ejemplo n.º 42
0
 public void ChangePage()
 {
     //if (index == 0)
     //{
     //	BtnPre.Hidden = true;
     //}
     //else {
     //	BtnPre.Hidden = false;
     //}
     LblPageCount.Text = (index + 1) + "/" + ViewControllers.Count;
     pageVC.SetViewControllers(new UIViewController[] { ViewControllers[index] },
                               UIPageViewControllerNavigationDirection.Forward,
                               true, null);
 }
Ejemplo n.º 43
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
                EdgesForExtendedLayout = UIRectEdge.None;

            _pageController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scroll, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.None);
            _pageController.SetViewControllers(new UIViewController[] { new Page1ViewController(base.ViewModel) }, UIPageViewControllerNavigationDirection.Forward, false, null);
            _pageController.DataSource = new PageDataSource(base.ViewModel);
            _pageController.View.Frame = this.View.Bounds;
            this.View.AddSubview(_pageController.View);
        }
Ejemplo n.º 44
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // create page/view
            pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);
            //sizes
            pageViewController.View.Frame = View.Bounds;
            //sets location
            View.AddSubviews(pageViewController.View);

            courseManager = new CourseManager();
            courseManager.MoveFirst();
            CoursePagerViewControllerDataSource dataSource = new CoursePagerViewControllerDataSource(courseManager);
            pageViewController.DataSource = dataSource;

            //OLD CourseViewController firstCourseViewController = CreateCoursesViewController();
            CourseViewController firstCourseViewController = dataSource.GetFirstViewController();

            pageViewController.SetViewControllers(new UIViewController[] { firstCourseViewController }, UIPageViewControllerNavigationDirection.Forward, false, null);

            //pageViewController.GetNextViewController = GetNextViewController;
            //pageViewController.GetPreviousViewController = GetPreviousViewController;
        }
        /// <summary>
        /// Calls after the controller’s view did loaded into memory.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Load document
            PDFDocument.OpenDocument(_DocumentName, _DocumentPath);

            // Init View
            Title = _DocumentName;
            View.BackgroundColor = UIColor.ScrollViewTexturedBackgroundColor;

            // Create toolbar
            if (MgrAccessor.OptionsMgr.Options.ToolbarVisible) {
                _Toolbar = CreateToolbar();
                if (_Toolbar != null) {
                    View.AddSubview(_Toolbar);
                }
            }

            // Create bottom bar (with slider)
            if (MgrAccessor.OptionsMgr.Options.BottombarVisible) {
                _BottomBar = CreateBottomBar();
                if (_BottomBar != null) {
                    View.AddSubview(_BottomBar);
                } else {
                    if (_Slider != null) {
                        _Slider.RemoveFromSuperview();
                        _Slider.Dispose();
                    }
                    if (_PageNumberLabel != null) {
                        _PageNumberLabel.RemoveFromSuperview();
                        _PageNumberLabel.Dispose();
                    }
                }
            }

            // Update Slider Max value
            UpdateSliderMaxValue();

            // Create the book PageView controller
            _BookPageViewController = new UIPageViewController(
                MgrAccessor.OptionsMgr.Options.PageTransitionStyle,
                MgrAccessor.OptionsMgr.Options.PageNavigationOrientation,
                UIPageViewControllerSpineLocation.Min);
            _BookPageViewController.View.Frame = GetBookPageViewFrameRect();
            _BookPageViewController.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            _BookPageViewController.View.BackgroundColor = UIColor.GroupTableViewBackgroundColor;
            _BookPageViewController.GetNextViewController = GetNextPageViewController;
            _BookPageViewController.GetPreviousViewController = GetPreviousPageViewController;
            _BookPageViewController.GetSpineLocation = GetSpineLocation;
            _BookPageViewController.DidFinishAnimating += delegate(object sender, UIPageViewFinishedAnimationEventArgs e) {
                PageFinishedAnimation(e.Completed, e.Finished, e.PreviousViewControllers);
            };
            _BookPageViewController.SetViewControllers(
                new UIViewController[] { GetPageViewController(1) },
                UIPageViewControllerNavigationDirection.Forward,
                false,
                s => ExecAfterOpenPageActions());

            AddChildViewController(_BookPageViewController);
            _BookPageViewController.DidMoveToParentViewController(this);
            View.AddSubview(_BookPageViewController.View);
        }
 /// <summary>
 /// Gets the spine location.
 /// </summary>
 /// <param name='pageController'>The book PageView controller.</param>
 /// <param name='orientation'>The device orientation.</param>
 /// <returns>The spine location.</returns>
 private UIPageViewControllerSpineLocation GetSpineLocation(UIPageViewController pageViewController, UIInterfaceOrientation orientation)
 {
     var currentPageVC = _GetCurrentPageContentVC();
     pageViewController.DoubleSided = false;
     pageViewController.SetViewControllers(new UIViewController[] { currentPageVC }, UIPageViewControllerNavigationDirection.Forward, true, s => { });
     return UIPageViewControllerSpineLocation.Min;
 }