示例#1
0
        private void OpenSelectServer()
        {
            SelectServerViewController ssvc = new SelectServerViewController(true);

            ssvc.DismissEvent        += HandleSelectServerDismissEvent;
            ssvc.CancelDownloadEvent += HandleCancelDownloadEvent;

            CustomNavigationController navController = new CustomNavigationController();

            navController.SetViewControllers(new UIViewController[] { ssvc }, true);
            AppDelegate.Current.Nav.PresentViewController(navController, true, null);
        }
示例#2
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            if (showIntro && isFirst)
            {
                isFirst          = false;
                this.View.Hidden = true;

                CustomNavigationController navController = new CustomNavigationController();
                navController.SetViewControllers(new UIViewController[] { new IntroViewController(false) }, false);
                this.NavigationController.PresentViewControllerAsync(navController, false);
            }
            else
            {
                this.View.Hidden = false;
            }
        }
示例#3
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            // Open introduction if this is the first time
            if (String.IsNullOrEmpty(URL.ServerURL))
            {
                ShowTutorial(false, true, false);
            }
            else if (!Settings.TutorialClosed)
            {
                ShowTutorial(false, false, false);
            }
            else
            {
                // Show authentication view before anything
                if (!Settings.Authenticated)
                {
                    AuthenticationController avc = new AuthenticationController();
                    avc.DismissedEvent += HandleAuthenticatedEvent;

                    CustomNavigationController navController = new CustomNavigationController();
                    navController.SetViewControllers(new UIViewController[] { avc }, false);
                    navController.NavigationBar.BarStyle = UIBarStyle.Default;
                    this.NavigationController.PresentViewController(navController, false, null);
                }
                else
                {
                    this.NavigationController.NavigationBar.SetBackgroundImage(UIImage.FromBundle("Assets/Backgrounds/home_nav.png").CreateResizableImage(new UIEdgeInsets(0, 120, 0, 1)), UIBarMetrics.Default);
                    this.NavigationController.NavigationBarHidden = false;
                    tabBarController.View.Hidden = false;

                    // Update My Books badge
                    CalculateMyBooksBadge();
                }
            }
        }
示例#4
0
        private void ShowTutorial(bool fromSettingsMenu, bool showIntro, bool animated)
        {
            TutorialViewController tvc = new TutorialViewController(showIntro);

            tvc.HideEvent += () =>
            {
                this.NavigationController.DismissViewController(true, delegate
                {
                    tvc.Dispose();
                    tvc = null;

                    if (!fromSettingsMenu)
                    {
                        HandleSelectServerDismissEvent(false);
                    }
                });
            };

            CustomNavigationController navController = new CustomNavigationController();

            navController.SetViewControllers(new UIViewController[] { tvc }, false);
            navController.NavigationBar.BarStyle = UIBarStyle.Default;
            this.NavigationController.PresentViewControllerAsync(navController, animated);
        }
示例#5
0
 protected AppDelegate()
 {
     nav = new CustomNavigationController();
 }
示例#6
0
        void HandleSettingRowSelectedEvent(NSIndexPath indexPath)
        {
            if (indexPath.Section == 0)
            {
                if (indexPath.Row == 0)
                {
                    HidePopovers();

                    settingViewController.Dispose();
                    settingViewController = null;

                    // Server Setting
                    OpenSelectServer();
                }
            }
            else
            {
                HidePopovers();

                if (indexPath.Row == 0)
                {
                    // About eBriefing
                    CustomNavigationController navController = new CustomNavigationController();
                    navController.NavigationBar.TintColor = UIColor.White;
                    navController.SetViewControllers(new UIViewController[] { new AboutViewController() }, false);
                    AppDelegate.Current.Nav.PresentViewController(navController, true, null);
                }
                else if (indexPath.Row == 1)
                {
                    // Tutorial
                    ShowTutorial(true, false, true);
                }
//                else if (indexPath.Row == 2)
//                {
//                    // Privacy Policy
//                    PrivacyPolicyViewController ppvc = new PrivacyPolicyViewController();
//                    ppvc.DismissEvent += delegate
//                    {
//                        this.DismissCurrentPopinControllerAnimated(true);
//                    };
//                    ppvc.View.Frame = new CGRect(0, 0, 646, 600);
//                    ppvc.SetPopinTransitionStyle(BKTPopinTransitionStyle.SpringySlide);
//                    ppvc.SetPopinOptions(BKTPopinOption.Default);
//                    ppvc.SetPopinTransitionDirection(BKTPopinTransitionDirection.Top);
//                    this.PresentPopinController(ppvc, true, null);
//                }
                else if (indexPath.Row == 2)
                {
                    if (MFMailComposeViewController.CanSendMail)
                    {
                        // Give Feedback
                        mailer           = new EmailComposer();
                        mailer.Recipient = "*****@*****.**";
                        mailer.Subject   = "eBriefing Feedback (iOS)";
                        mailer.Body      = "eBriefing App Version: " + Settings.AppVersion + "\niOS Version: " + Constants.Version
                                           + "\niOS Device: " + UIDevice.CurrentDevice.Model + "\n\nDescription of Problem, Concern, or Question:";

                        mailer.PresentViewController(this);
                    }
                    else
                    {
                        new UIAlertView("No mail account", "Please set up a Mail account in order to send a mail.", null, "Ok", null).Show();
                    }
                }
                else
                {
                    // Rate This App
                    MTiRate.iRate.SharedInstance.PromptForRating();
                }
            }
        }