/// <summary>
		/// Gets the animation controller for operation.
		/// </summary>
		/// <returns>The animation controller for operation.</returns>
		/// <param name="navigationController">Navigation controller.</param>
		/// <param name="operation">Operation.</param>
		/// <param name="fromViewController">From view controller.</param>
		/// <param name="toViewController">To view controller.</param>
		public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation (UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController) {
			return this.animator;
//			if (fromViewController.Title == "Splash") {
//				return this.animator;
//			} else {
//				return null;
//			}
		}
			public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation (UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
			{
				if (!fromViewController.GetType ().IsSubclassOf (typeof(UICollectionViewController)))
				    return null;
				if (!toViewController.GetType ().IsSubclassOf (typeof (UICollectionViewController)))
					return null;
				if (!transitionController.HasActiveInteraction)
					return null;

				transitionController.NavigationOperation = operation;
				return transitionController;
			}
		public IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation (UINavigationController navigationController,
		                                                                                  UINavigationControllerOperation operation,
		                                                                                  UIViewController fromViewController,
		                                                                                  UIViewController toViewController)
		{
			if (AppDelegate.NavigationControllerInteractionController != null) {
				AppDelegate.NavigationControllerInteractionController.WireToViewController (toViewController,
				                                                                            CEInteractionOperation.Pop);
			}

			if (AppDelegate.NavigationControllerAnimationController != null) {
				bool reverse = operation == UINavigationControllerOperation.Pop;
				AppDelegate.NavigationControllerAnimationController.Reverse = reverse;
			}

			return AppDelegate.NavigationControllerAnimationController;
		}
        public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(
            UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
        {
            //TODO: remove dependency on CitySelectViewController with interface or something else
            if (operation == UINavigationControllerOperation.Push && fromViewController is HomePageController vc1)
            {
                //Recognizer is added only on push so that user can interactively pop the presented screen.
                var recognizer = new UIScreenEdgePanGestureRecognizer();
                recognizer.Edges = UIRectEdge.Left;
                recognizer.AddTarget(() =>
                {
                    HandleRecognizer(recognizer, navigationController);
                });
                toViewController.View.AddGestureRecognizer(recognizer);
                return(new CustomTransition(operation, vc1.AnimationSourceView));
            }
            else if (operation == UINavigationControllerOperation.Pop && toViewController is HomePageController vc2)
            {
                return(new CustomTransition(operation, vc2.AnimationSourceView));
            }

            return(null);
        }
Esempio n. 5
0
 public IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation animationControllerForOperation, UIViewController fromViewController, UIViewController toViewController)
 {
     return(new CheckboardTransitionAnimator());
 }
Esempio n. 6
0
 public CustomTransition(UINavigationControllerOperation operation, UIView view)
 {
     this.operation = operation;
     sourceView     = view;
 }
        public IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
        {
            var fromView = fromViewController.View.ViewWithTag(10);

            if (fromView == null)
            {
                return(null);
            }
            var toView = toViewController.View.ViewWithTag(10);

            if (toView == null)
            {
                return(null);
            }
            return(new AnimatedPageRendererAnimatedTransitioning(fromView, toView, operation));
        }
 public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation (UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     if (toViewController is DurationChangeViewController) {
         var durationController = (DurationChangeViewController)toViewController;
         durationController.PreviousControllerType = fromViewController.GetType ();
         return new DurationChangeViewController.PushAnimator ();
     }
     if (fromViewController is DurationChangeViewController) {
         var durationController = (DurationChangeViewController)fromViewController;
         if (durationController.PreviousControllerType == toViewController.GetType ()) {
             return new DurationChangeViewController.PopAnimator ();
         }
         durationController.PreviousControllerType = null;
     }
     return null;
 }
Esempio n. 9
0
 public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     if (toViewController is DurationChangeViewController)
     {
         var durationController = (DurationChangeViewController)toViewController;
         durationController.PreviousControllerType = fromViewController.GetType();
         return(new DurationChangeViewController.PushAnimator());
     }
     if (fromViewController is DurationChangeViewController)
     {
         var durationController = (DurationChangeViewController)fromViewController;
         if (durationController.PreviousControllerType == toViewController.GetType())
         {
             return(new DurationChangeViewController.PopAnimator());
         }
         durationController.PreviousControllerType = null;
     }
     return(null);
 }
Esempio n. 10
0
		public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation (UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
		{
			return new OnboardingTransitionAnimator ();
		}
Esempio n. 11
0
        public IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
        {
            if ((fromViewController is ResponseDetailsViewController || toViewController is ResponseDetailsViewController) &&
                (operation == UINavigationControllerOperation.Pop || operation == UINavigationControllerOperation.Push))
            {
                return(new ResponseDetailsTransitionAnimator
                {
                    IsPresenting = operation == UINavigationControllerOperation.Push,
                    WantsInteractiveStart = false,
                });
            }

            return(null);
        }
 public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     if (operation == UINavigationControllerOperation.Push)
     {
         var image          = fromViewController.View.ViewWithTag(_id);
         var convertedFrame = image.ConvertRectToView(image.Bounds, fromViewController.View);
         _animator.ThumbnailFrame = convertedFrame;
     }
     _animator.Operation = operation;
     return(_animator);
 }
 public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     reversed = operation == UINavigationControllerOperation.Pop;
     //We need to return "something" that is not null so that the "GetInteractionControllerForAnimationController" is called
     return new CustomTransition ();
 }
Esempio n. 14
0
 public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     _transitioning.Animation = Animation;
     _transitioning.Reverse   = operation == UINavigationControllerOperation.Pop;
     return(_transitioning);
 }
 public AnimatedPageRendererAnimatedTransitioning(UIView fromView, UIView toView, UINavigationControllerOperation operation)
 {
     _fromView  = fromView;
     _toView    = toView;
     _operation = operation;
 }
Esempio n. 16
0
            public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
            {
                if (!fromViewController.GetType().IsSubclassOf(typeof(UICollectionViewController)))
                {
                    return(null);
                }
                if (!toViewController.GetType().IsSubclassOf(typeof(UICollectionViewController)))
                {
                    return(null);
                }
                if (!transitionController.HasActiveInteraction)
                {
                    return(null);
                }

                transitionController.NavigationOperation = operation;
                return(transitionController);
            }
Esempio n. 17
0
 public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     return(_animator);
 }
        public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
        {
            if (!_self.DisableTransition)
            {
                //At this point the property TargetPage refers to the view we are pushing or popping
                //This view is not yet visible in our app but the variable is already set
                var viewsToAnimate = new List <(UIView ToView, UIView FromView)>();

                IReadOnlyList <TransitionDetail> transitionStackTo;
                IReadOnlyList <TransitionDetail> transitionStackFrom;

                if (operation == UINavigationControllerOperation.Push)
                {
                    transitionStackFrom = _self.TransitionMap.GetMap(_self.PropertiesContainer, _self.SelectedGroup);
                    transitionStackTo   = _self.TransitionMap.GetMap(_self.LastPageInStack, null);
                }
                else
                {
                    transitionStackFrom = _self.TransitionMap.GetMap(_self.LastPageInStack, null);
                    transitionStackTo   = _self.TransitionMap.GetMap(_self.PropertiesContainer, _self.SelectedGroup);
                }

                if (transitionStackFrom != null)
                {
                    //Get all the views with transitions in the destination page
                    //With this, we are sure to dont start transitions with no mathing transitions in destination
                    foreach (var transitionToMap in transitionStackTo)
                    {
                        var toView = toViewController.View.ViewWithTag(transitionToMap.NativeViewId);
                        if (toView != null)
                        {
                            //Using LastOrDefault because the CollectionView created the first element twice
                            //and then hide the first without detaching the effect.
                            var fromView = transitionStackFrom.FirstOrDefault(x => x.TransitionName == transitionToMap.TransitionName);

                            if (fromView == null)
                            {
                                Debug.WriteLine($"The from view for {transitionToMap.TransitionName} does not exists in stack, ignoring the transition");
                                continue;
                            }

                            var fromNativeView = fromViewController.View.ViewWithTag(fromView.NativeViewId);
                            if (fromNativeView != null)
                            {
                                viewsToAnimate.Add((toView, fromNativeView));
                            }
                            else
                            {
                                Debug.WriteLine($"The native view with id {fromView.NativeViewId} for {transitionToMap.TransitionName} does not exists in page and has been removed from the MapStack");

                                Transition.RemoveTransition(fromView.View,
                                                            operation == UINavigationControllerOperation.Push
                                                                                ? _self.PropertiesContainer
                                                                                : _self.LastPageInStack);
                            }
                        }
                        else
                        {
                            Debug.WriteLine($"The destination ViewId {transitionToMap.NativeViewId} has no corrisponding Navive Views in tree and has been removed from the MapStack");

                            Transition.RemoveTransition(transitionToMap.View,
                                                        operation == UINavigationControllerOperation.Push
                                                                        ? _self.LastPageInStack
                                                                        : _self.PropertiesContainer);
                        }
                    }
                }

                //IF we have views to animate, proceed with custom transition and edge gesture
                //No view to animate = standard push & pop
                if (viewsToAnimate.Any())
                {
                    //deactivate normal pop gesture and activate the custom one suited for the shared transitions
                    if (operation == UINavigationControllerOperation.Push)
                    {
                        _self.AddInteractiveTransitionRecognizer();
                    }

                    return(new NavigationTransition(viewsToAnimate, operation, _self, _self.EdgeGestureRecognizer));
                }
            }

            /*
             * IMPORTANT!
             *
             * standard push & pop
             * i dont use my custom edgeswipe because it does not play well with standard pop
             * Doing this work here, is good for push.
             * When doing the custom, interactive, pop i need to double check the custom gesture later
             * (see comments in UIGestureRecognizerState.Ended)
             */

            _self.RemoveInteractiveTransitionRecognizer();
            return(null);
        }
Esempio n. 19
0
 public new IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     return(null);
 }
Esempio n. 20
0
        public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
        {
            if (!_self.DisableTransition)
            {
                //At this point the property TargetPage refers to the view we are pushing or popping
                //This view is not yet visible in our app but the variable is already set
                var viewsToAnimate = new List <(UIView ToView, UIView FromView)>();

                IReadOnlyList <TransitionDetail> transitionStackTo;
                IReadOnlyList <TransitionDetail> transitionStackFrom;

                if (operation == UINavigationControllerOperation.Push)
                {
                    transitionStackFrom = _self.TransitionMap.GetMap(_self.PropertiesContainer, _self.SelectedGroup);
                    transitionStackTo   = _self.TransitionMap.GetMap(_self.LastPageInStack, null);
                }
                else
                {
                    transitionStackFrom = _self.TransitionMap.GetMap(_self.LastPageInStack, null);
                    transitionStackTo   = _self.TransitionMap.GetMap(_self.PropertiesContainer, _self.SelectedGroup);
                }

                if (transitionStackFrom != null)
                {
                    //Get all the views with transitions in the destination page
                    //With this, we are sure to dont start transitions with no mathing transitions in destination
                    foreach (var transitionToMap in transitionStackTo)
                    {
                        if (transitionToMap.NativeView is UIView toView && toView != null)
                        {
                            //Using LastOrDefault because the CollectionView created the first element twice
                            //and then hide the first without detaching the effect.
                            var fromView = transitionStackFrom.FirstOrDefault(x => x.TransitionName == transitionToMap.TransitionName);

                            if (fromView == null)
                            {
                                Debug.WriteLine($"The from view for {transitionToMap.TransitionName} does not exists in stack, ignoring the transition");
                                continue;
                            }

                            if (fromView.NativeView is UIView fromNativeView && fromNativeView != null)
                            {
                                viewsToAnimate.Add((toView, fromNativeView));
                            }
                            else
                            {
                                Debug.WriteLine($"The native view with for {transitionToMap.TransitionName} does not exists in page and has been removed from the MapStack");

                                Transition.RemoveTransition(fromView.View,
                                                            operation == UINavigationControllerOperation.Push
                                                                                ? _self.PropertiesContainer
                                                                                : _self.LastPageInStack);
                            }
                        }
                        else
                        {
                            Debug.WriteLine($"The destination View for {transitionToMap.TransitionName} has no corrisponding Navive Views in tree and has been removed from the MapStack");

                            Transition.RemoveTransition(transitionToMap.View,
                                                        operation == UINavigationControllerOperation.Push
                                                                        ? _self.LastPageInStack
                                                                        : _self.PropertiesContainer);
                        }
                    }
Esempio n. 21
0
        public IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController,
                                                                                         UINavigationControllerOperation operation,
                                                                                         UIViewController fromViewController,
                                                                                         UIViewController toViewController)
        {
            if (AppDelegate.NavigationControllerInteractionController != null)
            {
                AppDelegate.NavigationControllerInteractionController.WireToViewController(toViewController,
                                                                                           CEInteractionOperation.Pop);
            }

            if (AppDelegate.NavigationControllerAnimationController != null)
            {
                bool reverse = operation == UINavigationControllerOperation.Pop;
                AppDelegate.NavigationControllerAnimationController.Reverse = reverse;
            }

            return(AppDelegate.NavigationControllerAnimationController);
        }
        public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
        {
            switch (operation)
            {
            case UINavigationControllerOperation.None:
                return(null);

            case UINavigationControllerOperation.Push:
                return(NavigationTransitionService.GetTransition(true, TransitionType, Options));

            case UINavigationControllerOperation.Pop:
                return(NavigationTransitionService.GetTransition(false, TransitionType, Options));
            }

            return(null);
        }