示例#1
0
        public override void PushDialogView(MobileDialogPresentationType presentationType, string viewTitle, IBaseView sourceView, IBaseView view)
        {
            Activity activity = null;
            var fragment = sourceView as Fragment;
            if (fragment != null)
            {
                activity = fragment.Activity;
            }
            else
            {
                activity = sourceView as Activity;
            }

            if (activity != null)
            {
                var dialogFragment = (DialogFragment) view;
                dialogFragment.Show(activity.FragmentManager, viewTitle);
            }
        }
示例#2
0
 public override void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, IBaseView view)
 {
     AppDelegate.PushDialogSubview(presentationType, parentViewTitle, (UIViewController)view);
 }
示例#3
0
 public override void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, IBaseView view)
 {
     // Not used on Android
     //PushDialogView(presentationType, string.Empty, null, view);
 }
示例#4
0
 public abstract void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, IBaseView view);
 public override void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, IBaseView view)
 {
 }
示例#6
0
 public abstract void PushDialogView(MobileDialogPresentationType presentationType, string viewTitle, IBaseView sourceView, IBaseView view);
 public override void PushDialogView(MobileDialogPresentationType presentationType, string viewTitle, IBaseView sourceView, IBaseView view)
 {
 }
示例#8
0
		public void AddViewController(UIViewController viewController, MobileDialogPresentationType presentationType)
		{
			var itemExists = _viewControllers.FirstOrDefault(x => x.Item1 == viewController);
			if (itemExists != null)
			{
				UIView.Animate(0.2, () => itemExists.Item1.View.Alpha = 1);
				return;
			}

			_viewControllers.Add(new Tuple<UIViewController, MobileDialogPresentationType>(viewController, presentationType));
			UIView view = viewController.View;		
			view.Alpha = 0;

			if (presentationType == MobileDialogPresentationType.TabBar)
			{
				// This one is a bit different; we are adding it as a child of the TabBar controller
				//TabBarController.AddChildViewController(viewController);
				//TabBarController.View.AddSubview(view);
				View.AddSubview(view);

				//viewController.View.BringSubviewToFront(view);
				//viewController.DidMoveToParentViewController(TabBarController);

				//var appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate;
				//appDelegate.root
			}
			else
			{
				AddChildViewController(viewController);
				View.AddSubview(view);
				viewController.View.BringSubviewToFront(view);
				viewController.DidMoveToParentViewController(this);
			}

			switch (presentationType)
			{
				case MobileDialogPresentationType.Overlay:
					view.Frame = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height);
					break;
				case MobileDialogPresentationType.NotificationBar:
					view.Frame = new RectangleF(0, View.Bounds.Height, View.Bounds.Width, 54);
					break;
				case MobileDialogPresentationType.TabBar:
					//view.Frame = new RectangleF(0, TabBarController.View.Bounds.Height, TabBarController.View.Bounds.Width, 54);
					float tabBarHeight = 49;
					view.Frame = new RectangleF(0, TabBarController.View.Bounds.Height - 54 - tabBarHeight, TabBarController.View.Bounds.Width, 54);
					view.Alpha = 1;
					break;
			}

			int notificationViewCount = _viewControllers.Count(x => x.Item2 == MobileDialogPresentationType.NotificationBar);
			switch (presentationType)
			{
				case MobileDialogPresentationType.Overlay:
					UIView.Animate(0.2, 0, UIViewAnimationOptions.CurveEaseInOut, () => view.Alpha = 1, null);
					break;
				case MobileDialogPresentationType.NotificationBar:
					UIView.Animate(0.4, 0, UIViewAnimationOptions.CurveEaseInOut, () =>
						{
							_isAnimating = true;
							view.Alpha = 1;
							view.Frame = new RectangleF(0, View.Bounds.Height - (notificationViewCount * 54), View.Bounds.Width, 54);
							TabBarController.View.Frame = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height - (notificationViewCount * 54));
						}, () => _isAnimating = false);
					break;
				case MobileDialogPresentationType.TabBar:
							float tabBarHeight = 49;
							view.Alpha = 1;
							view.Frame = new RectangleF(0, TabBarController.View.Bounds.Height - 54 - tabBarHeight, TabBarController.View.Bounds.Width, 54);

//					UIView.Animate(0.4, 0, UIViewAnimationOptions.CurveEaseInOut, () =>
//						{
//							float tabBarHeight = 49;
//							_isAnimating = true;
//							view.Alpha = 1;
//							view.Frame = new RectangleF(0, TabBarController.View.Bounds.Height - 54 - tabBarHeight, TabBarController.View.Bounds.Width, 54);
//							//TabBarController.View.Frame = new RectangleF(0, 0, View.Bounds.Width, View.Bounds.Height - 54);
//						}, () => _isAnimating = false);
					break;
			}
		}
 public override void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, IBaseView view)
 {
     Debug.WriteLine("WindowsPhoneNavigationManager - PushDialogSubview");
 }
示例#10
0
        public void PushDialogSubview(MobileDialogPresentationType presentationType, string parentViewTitle, UIViewController viewController)
        {
			Console.WriteLine("AppDelegate - PushDialogSubview - presentationType: {0} parentViewTitle: {1} viewController: {2}", presentationType, parentViewTitle, viewController.GetType().FullName);
            InvokeOnMainThread(() => {
                var navCtrl = _dialogNavigationControllers.FirstOrDefault(x => x.Key == parentViewTitle).Value;
                navCtrl.PushViewController(viewController, true);
            });
        }
示例#11
0
        public void PushDialogView(MobileDialogPresentationType presentationType, string viewTitle, UIViewController viewController)
        {
			Console.WriteLine("AppDelegate - PushDialogView - presentationType: {0} viewTitle: {1} viewController: {2}", presentationType, viewTitle, viewController.GetType().FullName);
            InvokeOnMainThread(() => {
                switch (presentationType)
                {
                    case MobileDialogPresentationType.Standard:
                        var navCtrl = new SessionsNavigationController(MobileNavigationTabType.More); // TODO: Remove tab type
                        navCtrl.SetTitle(viewTitle);

                        if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
                            navCtrl.NavigationBar.TintColor = UIColor.FromRGBA(0.2f, 0.2f, 0.2f, 1);                

                        navCtrl.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
                        navCtrl.ModalInPopover = true;
                        navCtrl.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
                        navCtrl.ViewDismissedEvent += (sender, e) => {
                            _dialogNavigationControllers.Remove(new KeyValuePair<string, SessionsNavigationController>(viewTitle, navCtrl));
                        };
                        navCtrl.PushViewController(viewController, false);                
                        _dialogNavigationControllers.Add(new KeyValuePair<string, SessionsNavigationController>(viewTitle, navCtrl));
						_mainViewController.PresentViewController(navCtrl, true, null);
                        // TODO: Remove navCtrl from list when dialog is closed.
                        break;
					default:
						_mainViewController.AddViewController(viewController, presentationType);
						break;
                }
            });
        }