public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
            {
                var element = _self.ElementForViewController(viewController);

                bool navBarVisible;

                if (element is ShellSection)
                {
                    navBarVisible = _self._renderer.ShowNavBar;
                }
                else
                {
                    navBarVisible = Shell.GetNavBarIsVisible(element);
                }

                navigationController.SetNavigationBarHidden(!navBarVisible, true);

                var coordinator = viewController.GetTransitionCoordinator();

                if (coordinator != null)
                {
                    // handle swipe to dismiss gesture
                    coordinator.NotifyWhenInteractionEndsUsingBlock((context) =>
                    {
                        if (!context.IsCancelled)
                        {
                            _self._popCompletionTask = new TaskCompletionSource <bool>();
                            _self.SendPoppedOnCompletion(_self._popCompletionTask.Task);
                        }
                    });
                }
            }
Esempio n. 2
0
            public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
            {
                var element = _self.ElementForViewController(viewController);

                bool navBarVisible;

                if (element is ShellSection)
                {
                    navBarVisible = _self._renderer.ShowNavBar;
                }
                else
                {
                    navBarVisible = Shell.GetNavBarIsVisible(element);
                }

                navigationController.SetNavigationBarHidden(!navBarVisible, true);

                var coordinator = viewController.GetTransitionCoordinator();

                if (coordinator != null && coordinator.IsInteractive)
                {
                    // handle swipe to dismiss gesture
                    if (Forms.IsiOS10OrNewer)
                    {
                        coordinator.NotifyWhenInteractionChanges(OnInteractionChanged);
                    }
                    else
                    {
                        coordinator.NotifyWhenInteractionEndsUsingBlock(OnInteractionChanged);
                    }
                }
            }
Esempio n. 3
0
        private void ShowSecretsView()
        {
            var         secret = currentSecret;
            RootElement root   = CreateRootElement();

            rootDVC = new StyledDialogViewController(root, null, backgroundColor)
            {
                Autorotate = true,
                HidesBottomBarWhenPushed = true
            };
            rootDVC.ViewAppearing += (sender, e) => {
                server.Abort();
                currentSecret = null;
                NSError err;
                Analytics.SharedTracker.TrackPageView("/secrets", out err);
                ReOrderSecrets();
            };

            var aboutButton = UIHelper.CreateInfoButton(40f, 60f);

            aboutButton.TouchDown += (sender, e) => {
                ShowAboutView();
            };
            rootDVC.View.AddSubview(aboutButton);

            navigation = new UINavigationController();
            Flurry.LogAllPageViews(navigation);
            navigation.SetNavigationBarHidden(true, false);
            navigation.PushViewController(rootDVC, false);

            window.RootViewController = navigation;

            if (ResharedItem != null)
            {
                var sbounds   = UIScreen.MainScreen.Bounds;
                var btnCancel = UIButton.FromType(UIButtonType.RoundedRect);
                btnCancel.Tag   = CANCEL_BUTTON_TAG;
                btnCancel.Frame = new RectangleF(
                    10,
                    sbounds.Height - 60f,
                    100,
                    30
                    );
                btnCancel.SetTitle("Cancel", UIControlState.Normal);
                btnCancel.SetTitleColor(UIColor.Black, UIControlState.Normal);
                btnCancel.TouchDown += delegate {
                    ResharedItem = null;
                    if (rootDVC.View.ViewWithTag(CANCEL_BUTTON_TAG) != null)
                    {
                        rootDVC.View.ViewWithTag(CANCEL_BUTTON_TAG).RemoveFromSuperview();
                    }
                    UpdateSecretsViewLabel(WELCOME_LABEL_TEXT);
                    DisplaySecretDetail(secret);
                };
                rootDVC.View.AddSubview(btnCancel);

                UpdateSecretsViewLabel(String.Format(SHARE_LABEL_TEXT, UrlHelper.GetFileName(ResharedItem.ItemPath)));
            }
        }
Esempio n. 4
0
        public static UINavigationController GetMessagePageControllerInNavigationController()
        {
            UIViewController       vc = MessagePageViewController.Create();
            UINavigationController navigationController = new UINavigationController(vc);

            navigationController.SetNavigationBarHidden(true, false);
            navigationController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            return(navigationController);
        }
Esempio n. 5
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            navController = NavigationController;
            if (navController != null)
            {
                navController.SetNavigationBarHidden(true, animated);
            }
        }
Esempio n. 6
0
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            if (navController != null)
            {
                navController.SetNavigationBarHidden(false, animated);
                navController = null;
            }
        }
Esempio n. 7
0
        public static void GoToResultPage(UIViewController parent, bool fromOnboarding)
        {
            UIViewController vc = InfectionStatusViewController.Create(fromOnboarding);

            UINavigationController navigationController = new UINavigationController(vc);

            navigationController.SetNavigationBarHidden(true, false);
            navigationController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            parent.PresentViewController(navigationController, true, null);
        }
Esempio n. 8
0
        public void Initialize(UIWindow window)
        {
            var rootViewController = new HomeViewController();

            _navigationController = new UINavigationController(rootViewController);
            _navigationController.SetNavigationBarHidden(true, false);
            _navigationController.SetToolbarHidden(true, false);

            window.RootViewController = _navigationController;
            window.MakeKeyAndVisible();
        }
Esempio n. 9
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            navController = NavigationController;
            if (navController != null)
            {
                navController.SetNavigationBarHidden(true, animated);
            }

            Google.Plus.SignIn.SharedInstance.Delegate = this;
        }
Esempio n. 10
0
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            if (navController != null)
            {
                navController.SetNavigationBarHidden(false, animated);
                navController = null;
            }

            Google.Plus.SignIn.SharedInstance.Finished -= OnGPlusFinished;
        }
Esempio n. 11
0
        public static void GoToWelcomeWhatsNewPage(UIViewController parent)
        {
            UIStoryboard storyboard = UIStoryboard.FromName("WelcomePageWhatIsNew", null);
            WelcomePageWhatIsNewViewController vc = storyboard.InstantiateInitialViewController() as WelcomePageWhatIsNewViewController;

            vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;

            UINavigationController navigationController = new UINavigationController(vc);

            navigationController.SetNavigationBarHidden(true, false);
            navigationController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            parent.PresentViewController(navigationController, true, null);
        }
        public static void GoToLanguageSelectionPage(UIViewController parent)
        {
            UIStoryboard storyboard            = UIStoryboard.FromName("LanguageSelection", null);
            LanguageSelectionViewController vc = storyboard.InstantiateInitialViewController() as LanguageSelectionViewController;

            vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;

            UINavigationController navigationController = new UINavigationController(vc);

            navigationController.SetNavigationBarHidden(true, false);
            navigationController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
            parent.PresentViewController(navigationController, true, null);
        }
Esempio n. 13
0
 async void OnAreYouInfectedBtnTapped(object sender, EventArgs e)
 {
     if (await _viewModel.IsRunning())
     {
         UINavigationController navigationController = new UINavigationController(InformationAndConsentViewController.GetInformationAndConsentViewController());
         navigationController.SetNavigationBarHidden(true, false);
         navigationController.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
         PresentViewController(navigationController, true, null);
     }
     else
     {
         DialogHelper.ShowDialog(this, _viewModel.ReportingIllDialogViewModel, null);
     }
 }
Esempio n. 14
0
        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            _facebook = new FacebookSdk.Facebook(kAppId);

            mainView = new MainView(_facebook);
            controller = new UINavigationController(mainView);
            controller.SetNavigationBarHidden(true, false);
            controller.NavigationBar.TintColor = mainView.FacebookBlue;

            window.AddSubview(controller.View);
            window.MakeKeyAndVisible();

            return true;
        }
        public MainViewController()
        {
            outerButton = new UIButton();
            outerButton.SetTitle("Outer MainVC Button", UIControlState.Normal);
            outerButton.BackgroundColor = UIColor.Blue;
            outerButton.SetTitleColor(UIColor.White, UIControlState.Normal);
            outerButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                PresentViewController(new MyModalViewController(), true, null);
            };

            navController = new UINavigationController();
            navController.View.BackgroundColor = UIColor.Brown;
            navController.SetNavigationBarHidden(true, false);
        }
        public MainViewController()
        {
            outerButton = new UIButton ();
            outerButton.SetTitle ("Outer MainVC Button", UIControlState.Normal);
            outerButton.BackgroundColor = UIColor.Blue;
            outerButton.SetTitleColor (UIColor.White, UIControlState.Normal);
            outerButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                PresentViewController(new MyModalViewController(), true, null);
            };

            navController = new UINavigationController ();
            navController.View.BackgroundColor = UIColor.Brown;
            navController.SetNavigationBarHidden (true, false);
        }
Esempio n. 17
0
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            if (navController != null)
            {
                navController.SetNavigationBarHidden(false, animated);
                navController = null;
            }

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

            _nav = new UINavigationController();
            _nav.SetNavigationBarHidden(true, false);
            //_nav.PushViewController (new CreateVehicle (), false);
            _nav.PushViewController(new Login(), false);
            window.RootViewController = _nav;

            // make the window visible
            window.MakeKeyAndVisible();

            return(true);
        }
Esempio n. 19
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);

            UINavigationController navController = new UINavigationController();
            navController.SetNavigationBarHidden(true, false);
            navController.SetViewControllers(new UIViewController[] { new SnakeViewController() }, true);

            // Show
            Window.RootViewController = navController;
            Window.MakeKeyAndVisible();

            return true;
        }
            public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
            {
                var element = _self.ElementForViewController(viewController);

                bool navBarVisible;

                if (element is ShellSection)
                {
                    navBarVisible = _self._renderer.ShowNavBar;
                }
                else
                {
                    navBarVisible = Shell.GetNavBarIsVisible(element);
                }

                navigationController.SetNavigationBarHidden(!navBarVisible, true);
            }
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            var viewController = new VideoListViewController();

            var navController = new UINavigationController(viewController);

            navController.SetNavigationBarHidden(true, false);

            // create a new window instance based on the screen size
            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            Window.RootViewController = navController;
            // If you have defined a root view controller, set it here:
            // Window.RootViewController = myViewController;

            // make the window visible
            Window.MakeKeyAndVisible();

            return(true);
        }
Esempio n. 22
0
            public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
            {
                var element = _self.ElementForViewController(viewController);

                bool navBarVisible = true;

                //if (element is BindableObject bo)
                //	navBarVisible = NavigationView.GetHasNavigationBar(bo);

                navigationController.SetNavigationBarHidden(!navBarVisible, true);

                var coordinator = viewController.GetTransitionCoordinator();

                if (coordinator != null && coordinator.IsInteractive)
                {
                    // handle swipe to dismiss gesture
                    coordinator.NotifyWhenInteractionChanges(OnInteractionChanged);
                }
            }
Esempio n. 23
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // On précise que la fenêtre prend toute la place de l’écran
            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            Window.BackgroundColor = ApplicationColors.WindowBackgroundColor;
            InitializeIoC();

            // Initialisation du contrôleur de vue par défaut
            var viewController = new SplashScreenViewController();

            // Initialisation du contrôleur de navigation
            var navigationController = new UINavigationController(viewController);

            Window.RootViewController = navigationController;

            // Affiche la fenêtre principale
            Window.MakeKeyAndVisible();
            navigationController.SetNavigationBarHidden(true, false);
            navigationController.NavigationBar.TintColor    = UIColor.White;
            navigationController.NavigationBar.BarTintColor = ApplicationColors.MainColor;
            navigationController.NavigationBar.BarStyle     = UIBarStyle.Black;
            Window.MakeKeyAndVisible();
            return(true);
        }
Esempio n. 24
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            MapServices.ProvideAPIKey ("AIzaSyA8WOvgGyHaw3rgkeYuUIqkIxhmW9Hrdjc");

            locationManager = new CLLocationManager ();
            locationManager.Delegate = new locationManagerDelegate ();
            locationManager.DesiredAccuracy = CLLocation.AccuracyBest;

            locationManager.RequestAlwaysAuthorization ();

            if (locationManager.RespondsToSelector (new Selector ("requestWhenInUseAuthorization")))
            {
                locationManager.RequestWhenInUseAuthorization ();
            }
            if (CLLocationManager.LocationServicesEnabled) {
                locationManager.StartUpdatingLocation ();
            }

            ProgressHUD.Shared.HudForegroundColor = UIColor.Gray;
            ProgressHUD.Shared.Ring.Color = UIColor.FromRGB(44/255f,146/255f,208/255f);
            ProgressHUD.Shared.HudForegroundColor = UIColor.FromRGB(44/255f,146/255f,208/255f);

            UIApplication.SharedApplication.SetStatusBarStyle (UIStatusBarStyle.LightContent, true);

            this.Window = new UIWindow (UIScreen.MainScreen.Bounds);
            UINavigationController navigation = new UINavigationController(new StartingScreen());
            navigation.NavigationBar.TintColor = UIColor.White;
            navigation.NavigationBar.BarTintColor = UIColor.FromRGB(44/255f,146/255f,208/255f);
            navigation.NavigationBar.BarStyle = UIBarStyle.Black;
            navigation.SetNavigationBarHidden (true,true);

            this.Window.RootViewController = navigation;
            this.Window.MakeKeyAndVisible ();

            return true;
        }
Esempio n. 25
0
		public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
		{
//			if (1 == 1) {
//				UIAlertView alert = new UIAlertView ();
//				alert.Title = "升级提醒";
//				alert.Message="发现有新版本可以更新,请尽快更新,否则影响正常使用";
//				alert.AddButton ("进行升级");
//				alert.AddButton ("取消");
//				alert.Dismissed += Alert_Dismissed;
//				alert.Show ();
//			}

			_window = new UIWindow (UIScreen.MainScreen.Bounds);
			UINavigationController _nva = new UINavigationController ();
			_nva.SetNavigationBarHidden (true, false);

			//自动登录
			Sys_User lastLoginUser = new UserProcess ().GetLastLoginUser ();
			if (lastLoginUser != null) {
				//系统静态存储
				SystemObject.User = lastLoginUser;
				//更新登录状态到数据库?

				//跳转到主页面

				_nva.PushViewController (new MainController (), true);
			} else {
				_nva.PushViewController (new ViewController (), true);
			}



			_window.RootViewController = _nva;
			_window.MakeKeyAndVisible ();
			return true;
		}
        public override void ViewWillAppear (bool animated)
        {
            base.ViewWillAppear (animated);

            SignIn.SharedInstance.Delegate = this;
            SignIn.SharedInstance.UIDelegate = this;

            navController = NavigationController;
            if (navController != null) {
                navController.SetNavigationBarHidden (true, animated);
            }
        }
Esempio n. 27
0
 public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
 {
     navigationController.SetNavigationBarHidden(false, true);
 }
Esempio n. 28
0
        private void ShowSecretsView()
        {
            var secret = currentSecret;
            RootElement root = CreateRootElement ();
            rootDVC = new StyledDialogViewController (root, null, backgroundColor)
            {
                Autorotate = true,
                HidesBottomBarWhenPushed = true
            };
            rootDVC.ViewAppearing += (sender, e) => {
                server.Abort ();
                currentSecret = null;
                NSError err;
                Analytics.SharedTracker.TrackPageView ("/secrets", out err);
                ReOrderSecrets ();
            };

            var aboutButton = UIHelper.CreateInfoButton(40f, 60f);
            aboutButton.TouchDown += (sender, e) => {
                ShowAboutView();
            };
            rootDVC.View.AddSubview(aboutButton);

            navigation = new UINavigationController ();
            Flurry.LogAllPageViews(navigation);
            navigation.SetNavigationBarHidden (true, false);
            navigation.PushViewController (rootDVC, false);

            window.RootViewController = navigation;

            if (ResharedItem != null)
            {
                var sbounds = UIScreen.MainScreen.Bounds;
                var btnCancel = UIButton.FromType (UIButtonType.RoundedRect);
                btnCancel.Tag = CANCEL_BUTTON_TAG;
                btnCancel.Frame = new RectangleF (
                    10,
                    sbounds.Height - 60f,
                    100,
                    30
                    );
                btnCancel.SetTitle ("Cancel", UIControlState.Normal);
                btnCancel.SetTitleColor (UIColor.Black, UIControlState.Normal);
                btnCancel.TouchDown += delegate {
                    ResharedItem = null;
                    if (rootDVC.View.ViewWithTag(CANCEL_BUTTON_TAG) != null) {
                        rootDVC.View.ViewWithTag(CANCEL_BUTTON_TAG).RemoveFromSuperview();
                    }
                    UpdateSecretsViewLabel(WELCOME_LABEL_TEXT);
                    DisplaySecretDetail(secret);
                };
                rootDVC.View.AddSubview (btnCancel);

                UpdateSecretsViewLabel(String.Format(SHARE_LABEL_TEXT, UrlHelper.GetFileName(ResharedItem.ItemPath)));
            }
        }
Esempio n. 29
0
        public override void ViewWillAppear (bool animated)
        {
            base.ViewWillAppear (animated);

            navController = NavigationController;
            if (navController != null) {
                navController.SetNavigationBarHidden (true, animated);
            }

            Google.Plus.SignIn.SharedInstance.Finished += OnGPlusFinished;
        }
Esempio n. 30
0
        private void DisplaySecretDetail(Secret s)
        {
            NSError error;

            Analytics.SharedTracker.TrackPageView("/session", out error);

            var subRoot = new RootElement(s.Phrase)
            {
                (shareSection = new Section("Keep on server (1 min)")
                {
                    (pickPhoto = new StyledStringElement("Photo", delegate { ShowImagePicker(); })),
                    (dataEntry = new AdvancedEntryElement("Text", "your message", null))
                }),
                (entriesSection = new Section("History"))
            };

            pickPhoto.Accessory     = UITableViewCellAccessory.DisclosureIndicator;
            dataEntry.ShouldReturn += delegate {
                UIApplication.SharedApplication.InvokeOnMainThread(delegate {
                    dataEntry.GetContainerTableView().EndEditing(true);
                }
                                                                   );

                server.Send(dataEntry.Value.Trim());

                return(true);
            };
            dataEntry.ReturnKeyType = UIReturnKeyType.Send;


            entriesSection.Elements.AddRange(
                from d in s.DataItems
                select((Element)CreateDataItemElement(d))
                );

            subRoot.UnevenRows = true;

            sectionDVC = new StyledDialogViewController(
                subRoot,
                true,
                null,
                backgroundColor
                );
            sectionDVC.HidesBottomBarWhenPushed = false;
            navigation.SetNavigationBarHidden(false, true);
            navigation.PushViewController(sectionDVC, true);

            server.CurrentSecret = s;
            currentSecret        = s;
            server.Listen();

            currentSecret.WatchEvent += (secret) => {
                int    count   = secret.ListenersCount - 1;
                string pattern = "Keep on server (1 min)";
                if (count > 0)
                {
                    pattern = (count) > 1 ? "Share with {0} devices" : "Share with {0} device";
                }
                UIApplication.SharedApplication.InvokeOnMainThread(delegate {
                    shareSection.Caption = string.Format(pattern, count);
                    if (sectionDVC != null)
                    {
                        sectionDVC.ReloadData();
                    }
                }
                                                                   );
            };

            sectionDVC.ViewAppearing += delegate {
                if (navigation.View.ViewWithTag(SHARE_BUTTON_TAG) != null)
                {
                    navigation.View.ViewWithTag(SHARE_BUTTON_TAG).RemoveFromSuperview();
                }
            };

            if (ResharedItem != null)
            {
                ReshareData();
            }
        }
Esempio n. 31
0
        public override void ViewWillAppear (bool animated)
        {
            base.ViewWillAppear (animated);

            navController = NavigationController;
            if (navController != null) {
                navController.SetNavigationBarHidden (true, animated);
            }
        }