예제 #1
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)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);


            Util.VisualMode = VisualMode.None;
            //Util.VisualMode = VisualMode.TintColor;
            //Util.VisualMode = VisualMode.UIAppearance;
            AppearanceManager.SetAppearance();

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;
            
            tabBar = new UITabBarController();
            loginDvc = new LoginDialogViewController();


            //have a look at the ExpenseModel class to see why it's hard to do 
            // theming on MonoTouch.Dialog auto-generated stuff
            var expense = new ExpenseModel();
            var context = new BindingContext(null, expense, "Expenses");
            expenseDvc = new BaseDialogViewController(context.Root);
            expenseDvc.Title = "Expenses";
            
            var tabControllers = new UINavigationController[] {
            

                new UINavigationController(loginDvc) {
                    TabBarItem = new UITabBarItem("Login", Resources.Padlock, 1)
                },
                new UINavigationController(expenseDvc) {
                    TabBarItem = new UITabBarItem("Expenses", Resources.Expense, 2)
                }


                /*
                new UINavigationController(deadlines) {
                    TabBarItem = new UITabBarItem("Deadlines", Resources.Deadlines, 2)
                },
                new UINavigationController(reports) {
                    TabBarItem = new UITabBarItem("Reports", Resources.Deadlines, 4)
                },
                new UINavigationController(you) {
                    TabBarItem = new UITabBarItem("You", Resources.You, 3)
                }
                */

                
            };
            
            tabBar.SetViewControllers(tabControllers, false);
            

            window.RootViewController = tabBar;
            window.MakeKeyAndVisible ();
			
            return true;
        }
예제 #2
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)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);


            Util.VisualMode = VisualMode.None;
            //Util.VisualMode = VisualMode.TintColor;
            //Util.VisualMode = VisualMode.UIAppearance;
            AppearanceManager.SetAppearance();

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;

            tabBar   = new UITabBarController();
            loginDvc = new LoginDialogViewController();


            //have a look at the ExpenseModel class to see why it's hard to do
            // theming on MonoTouch.Dialog auto-generated stuff
            var expense = new ExpenseModel();
            var context = new BindingContext(null, expense, "Expenses");

            expenseDvc       = new BaseDialogViewController(context.Root);
            expenseDvc.Title = "Expenses";

            var tabControllers = new UINavigationController[] {
                new UINavigationController(loginDvc)
                {
                    TabBarItem = new UITabBarItem("Login", Resources.Padlock, 1)
                },
                new UINavigationController(expenseDvc)
                {
                    TabBarItem = new UITabBarItem("Expenses", Resources.Expense, 2)
                }


                /*
                 * new UINavigationController(deadlines) {
                 *  TabBarItem = new UITabBarItem("Deadlines", Resources.Deadlines, 2)
                 * },
                 * new UINavigationController(reports) {
                 *  TabBarItem = new UITabBarItem("Reports", Resources.Deadlines, 4)
                 * },
                 * new UINavigationController(you) {
                 *  TabBarItem = new UITabBarItem("You", Resources.You, 3)
                 * }
                 */
            };

            tabBar.SetViewControllers(tabControllers, false);


            window.RootViewController = tabBar;
            window.MakeKeyAndVisible();

            return(true);
        }
예제 #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.NavigationItem.Title = "Vault";

            UITabBarController barChoices = new UITabBarController();

            ResultsControllerTotal resultControl    = this.Storyboard.InstantiateViewController("ResultsControllerTotal") as ResultsControllerTotal;
            BudgetController       budgetController = this.Storyboard.InstantiateViewController("BudgetController") as BudgetController;
            CameraController       cameraControl    = this.Storyboard.InstantiateViewController("CameraController") as CameraController;
            SettingsController     settings         = this.Storyboard.InstantiateViewController("SettingsController") as SettingsController;

            barChoices.SetViewControllers(new UIViewController[] { resultControl, budgetController, cameraControl, settings }, true);

            barChoices.TabBar.Hidden   = false;
            barChoices.TabBar.BarStyle = UIBarStyle.Default;
            barChoices.TabBar.SelectedImageTintColor = UIColor.Red;

            barChoices.TabBar.Items[0].Title = "Vault";;
            barChoices.TabBar.Items[1].Title = "Manual";
            barChoices.TabBar.Items[2].Title = "Camera";
            barChoices.TabBar.Items[3].Title = "Settings";

            barChoices.ViewControllerSelected += (object sender, UITabBarSelectionEventArgs e) =>
            {
                switch (barChoices.SelectedIndex)
                {
                case 0:
                    this.NavigationItem.Title = "Vault";
                    this.NavigationItem.SetLeftBarButtonItem(null, true);
                    this.NavigationItem.SetRightBarButtonItem(null, true);
                    break;

                case 1:
                    this.NavigationItem.Title = "Manual Input";
                    this.NavigationItem.SetLeftBarButtonItem(null, true);
                    this.NavigationItem.SetRightBarButtonItem(null, true);
                    break;

                case 2:
                    this.NavigationItem.Title = "Take a Photo";
                    this.NavigationItem.SetRightBarButtonItem(null, true);
                    this.NavigationItem.SetLeftBarButtonItem(null, true);
                    break;

                default:
                    this.NavigationItem.Title = "Settings";
                    this.NavigationItem.SetRightBarButtonItem(null, true);
                    this.NavigationItem.SetLeftBarButtonItem(null, true);
                    break;
                }
                ;
            };
            this.NavigationController.AddChildViewController(barChoices);
        }
예제 #4
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);

            ThemeManager.ApplyTheme();

            var tabs = new UITabBarController();

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;

            var firstdvc = BuildDialogViewController();

            firstdvc.NavigationItem.RightBarButtonItems = new [] {
                new UIBarButtonItem(UIBarButtonSystemItem.Add, delegate {}),
                new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate {})
            };

            var tabControllers = new UINavigationController[] {
                new UINavigationController(firstdvc)
                {
                    TabBarItem = new UITabBarItem("First", Theme.Resources.TempIcon, 1)
                },
                new UINavigationController(BuildDialogViewController(style: UITableViewStyle.Plain))
                {
                    TabBarItem = new UITabBarItem("Second", Theme.Resources.TempIcon, 1)
                },
                new UINavigationController(BuildControlsDialogViewController())
                {
                    TabBarItem = new UITabBarItem("Controls", Theme.Resources.TempIcon, 1)
                },
                new UINavigationController(BuildDialogViewController(style: UITableViewStyle.Plain))
                {
                    TabBarItem = new UITabBarItem("Second", Theme.Resources.TempIcon, 1)
                }
            };


            tabs.SetViewControllers(tabControllers, false);


            // If you have defined a root view controller, set it here:
            window.RootViewController = tabs;

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

            return(true);
        }
예제 #5
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			UITabBarController tabBarController = new UITabBarController ();
			tabBarController.SetViewControllers (new UIViewController[] {
				new GraphViewController ("Accelerometer", MotionDataType.AccelerometerData), 
				new GraphViewController ("Gyro", MotionDataType.GyroData), 
				new GraphViewController ("DeviceMotion", MotionDataType.DeviceMotion)
			}, true);

			window.RootViewController = tabBarController;
			window.MakeKeyAndVisible ();

			return true;
		}
예제 #6
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            tabs = new UITabBarController();

            tabs.SetViewControllers(new UIViewController[] {
                new UINavigationController(new HomeController()),
                new UINavigationController(new PhotosController()),
                new UINavigationController(new ProfileController()),
                new UINavigationController(new CirclesController()),
            }, false);
            window.AddSubview(tabs.View);

            window.MakeKeyAndVisible();

            return(true);
        }
예제 #7
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            UITabBarController tabBarController = new UITabBarController();

            tabBarController.SetViewControllers(new UIViewController[] {
                new GraphViewController("Accelerometer", MotionDataType.AccelerometerData),
                new GraphViewController("Gyro", MotionDataType.GyroData),
                new GraphViewController("DeviceMotion", MotionDataType.DeviceMotion)
            }, true);

            window.RootViewController = tabBarController;
            window.MakeKeyAndVisible();

            return(true);
        }
예제 #8
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            tabs = new UITabBarController ();

            tabs.SetViewControllers (new UIViewController[] {
                new UINavigationController (new HomeController ()),
                new UINavigationController (new PhotosController ()),
                new UINavigationController (new ProfileController ()),
                new UINavigationController (new CirclesController ()),

            }, false);
            window.AddSubview (tabs.View);

            window.MakeKeyAndVisible ();

            return true;
        }
예제 #9
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);

            ThemeManager.ApplyTheme ();

            var tabs = new UITabBarController ();

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;

            var firstdvc = BuildDialogViewController ();
            firstdvc.NavigationItem.RightBarButtonItems = new [] {
                new UIBarButtonItem(UIBarButtonSystemItem.Add, delegate {}),
                new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate {})

            };

            var tabControllers = new UINavigationController[] {

                new UINavigationController(firstdvc) {
                    TabBarItem = new UITabBarItem("First", Theme.Resources.TempIcon, 1)
                },
                new UINavigationController(BuildDialogViewController(style: UITableViewStyle.Plain)) {
                    TabBarItem = new UITabBarItem("Second", Theme.Resources.TempIcon, 1)
                },
                new UINavigationController(BuildControlsDialogViewController()) {
                    TabBarItem = new UITabBarItem("Controls", Theme.Resources.TempIcon, 1)
                },
                new UINavigationController(BuildDialogViewController(style: UITableViewStyle.Plain)) {
                    TabBarItem = new UITabBarItem("Second", Theme.Resources.TempIcon, 1)
                }

            };

            tabs.SetViewControllers (tabControllers, false);

            // If you have defined a root view controller, set it here:
            window.RootViewController = tabs;

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

            return true;
        }
예제 #10
0
        partial void StartGameButton_TouchUpInside(UIButton sender)
        {
            var TabView = new UITabBarController();

            MapManager mapman = MapManager.Instance;

            mapman.GenMap();
            //mapman.WriteMap();


            dngNav = new UINavigationController(mapman.GetFirstRoom());


            //var dungeonRoom = mapman.GetFirstRoom();
            var mapView       = new VC_MapView();
            var inventoryView = new VC_Inventory();

            List <UIViewController> tabs = new List <UIViewController>();

            tabs.Add(dngNav);
            tabs.Add(mapView);
            tabs.Add(inventoryView);

            UIImage GameViewIcon      = UIImage.FromBundle("Tab Icon Images/ViewTabIcon.png");
            UIImage MapViewIcon       = UIImage.FromBundle("Tab Icon Images/MapTabIcon.png");
            UIImage InventoryViewIcon = UIImage.FromBundle("Tab Icon Images/itemsTabIcon.png");

            tabs[0].TabBarItem = new UITabBarItem("Game", GameViewIcon, GameViewIcon);
            tabs[1].TabBarItem = new UITabBarItem("Map", MapViewIcon, MapViewIcon);
            tabs[2].TabBarItem = new UITabBarItem("Inventory", InventoryViewIcon, InventoryViewIcon);
            TabView.SetViewControllers(tabs.ToArray(), true);

            Item_RustySword rustySword = new Item_RustySword();

            GameManager.Instance.playerCharacter.equipment.Add(rustySword);

            Item_HealthPotion HPPotion = new Item_HealthPotion();

            GameManager.Instance.playerCharacter.bag.Add(HPPotion);
            GameManager.Instance.playerCharacter.UpdateStats();

            PresentViewController(TabView, true, null);
        }
예제 #11
0
        void CreatePhoneGui()
        {
            tabbarController = new RotatingTabBar();
            MainView         = tabbarController.View;
            window.AddSubview(MainView);

            main      = new TimelineViewController(Locale.GetText("Friends"), TweetKind.Home, false);
            mentions  = new TimelineViewController(Locale.GetText("Mentions"), TweetKind.Replies, false);
            messages  = new TimelineViewController(Locale.GetText("Messages"), TweetKind.Direct, false);
            searches  = new SearchesViewController();
            favorites = StreamedTimelineViewController.MakeFavorites("http://api.twitter.com/1/favorites.json");

            navigationRoots = new UINavigationController [5] {
                new UINavigationController(main)
                {
                    TabBarItem = new UITabBarItem(Locale.GetText("Friends"), UIImage.FromBundle("Images/home.png"), 0),
                },
                new UINavigationController(mentions)
                {
                    TabBarItem = new UITabBarItem(Locale.GetText("Mentions"), UIImage.FromBundle("Images/replies.png"), 1)
                },
                new UINavigationController(messages)
                {
                    TabBarItem = new UITabBarItem(Locale.GetText("Messages"), UIImage.FromBundle("Images/messages.png"), 2)
                },
                new UINavigationController(favorites)
                {
                    TabBarItem = new UITabBarItem(Locale.GetText("Favorites"), UIImage.FromBundle("Images/fav.png"), 3)
                },
                new UINavigationController(searches)
                {
                    TabBarItem = new UITabBarItem(Locale.GetText("Search"), UIImage.FromBundle("Images/lupa.png"), 4)
                }
            };

            CheckDatabase();
            tabbarController.SetViewControllers(navigationRoots, false);

#if false && DEBUGIMAGE
            AddDebugHook();
#endif
        }
예제 #12
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // create a new window instance based on the screen size
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            // If you have defined a root view controller, set it here:
            // Window.RootViewController = myViewController;
            ViewController1 firstViewController  = new ViewController1();
            ViewController2 secondViewController = new ViewController2();

            UIViewController[] controllers = new UIViewController[] { firstViewController, secondViewController };


            UITabBarController tabController = new UITabBarController();

            tabController.SetViewControllers(controllers, true);
            tabController.TabBar.Items[0].Title   = "First";
            tabController.TabBar.Items[1].Title   = "Second";
            tabController.ViewControllerSelected += (sender, e) => {
                if (e.ViewController == firstViewController)
                {
                    UIAlertView alert = new UIAlertView();
                    alert.Title = "打开first";
                    alert.AddButton("cancel");
                    alert.Show();
                }
                else
                {
                    UIAlertView alert = new UIAlertView();
                    alert.Title = "打开second";
                    alert.AddButton("cancel");
                    alert.Show();
                }
            };
            Window.RootViewController = tabController;

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

            return(true);
        }
예제 #13
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)
        {
            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);

            UIImage normal = UIImage.FromBundle("Images/camera.png");
            UIImage highlight = UIImage.FromBundle("Images/cameraSelected.png");
            UIImage navBg = UIImage.FromBundle("Images/navigationBarBackgroundRetro.png");

            tabBar = new UIRaisedCenterButtonTabBar(normal, highlight, delegate { var alert = new UIAlertView("Center Button","That Big Ass Button Was Pushed", null, "Ok"); alert.Show(); });

            UIViewController vc = new UIViewController();

            navigationRoots = new UINavigationController [5] {
                new UINavigationController  (vc) {
                    TabBarItem = new UITabBarItem ("Home", UIImage.FromBundle ("Images/tab_feed.png"), 0)
                },
                new UINavigationController  (vc) {
                    TabBarItem = new UITabBarItem ("Live", UIImage.FromBundle ("Images/tab_live.png"), 1)
                },
                new UINavigationController  (vc) {
                    TabBarItem = new UITabBarItem ("", null, 2)
                },
                new UINavigationController  (vc) {
                    TabBarItem = new UITabBarItem ("Profile", UIImage.FromBundle ("Images/tab_feed_profile.png"), 3)
                },
                new UINavigationController  (vc) {
                    TabBarItem = new UITabBarItem ("Messages", UIImage.FromBundle ("Images/tab_messages.png"), 4)
                }
            };

            tabBar.SetViewControllers (navigationRoots, false);

            window.Add(tabBar.View);
            window.MakeKeyAndVisible ();

            return true;
        }
예제 #14
0
        partial void LinkTouchUpInside(MonoTouch.Foundation.NSObject sender)
        {
            UITabBarController parentTabBar = this.ParentViewController as UITabBarController;

            if (_webView == null)
            {
                _webView = new UIWebView(this.View.Bounds);

                UIViewController webViewController = new UIViewController();
                webViewController.View             = _webView;
                webViewController.Title            = "Adaptive";
                webViewController.TabBarItem.Image = UIImage.FromBundle("adaptive");

                List <UIViewController> tabBarViewControllers = new List <UIViewController>(parentTabBar.ViewControllers);
                tabBarViewControllers.Add(webViewController);
                parentTabBar.SetViewControllers(tabBarViewControllers.ToArray(), false);
            }

            string url = "http://www.weareadaptive.com";

            _webView.LoadRequest(new NSUrlRequest(new NSUrl(url)));

            parentTabBar.SelectedIndex = parentTabBar.ViewControllers.Length - 1;
        }
예제 #15
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)
        {
            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);

            //TripLog.MakeDummyData();

            Util.Log("In finished launching (with options)");


            bool localNotification = false;

            if (options != null)
            {
                if (Util.IsIOS4OrBetter)
                {
                    UILocalNotification localNotif = (UILocalNotification)options.ObjectForKey(UIApplication.LaunchOptionsLocalNotificationKey);

                    if (localNotif != null)
                    {
                        localNotification = true;
                    }
                }
            }

            Util.LogStartup();


            var bikes = BikeLocation.AllBikes;


            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;
            tabBar = new UITabBarController(); MainView = tabBar.View;
            window.AddSubview(MainView);


            near     = new NearDialogViewController();
            map      = new MapViewController();
            tripLog  = new TripLogViewController();
            infoPage = new InfoViewController();


            timer = new TimerViewController {
                TabBarItem = new UITabBarItem("Timer", Resources.Timer, 1)
            };

            tabControllers = new UIViewController[] {
                new UINavigationController(near)
                {
                    TabBarItem = new UITabBarItem("Near", Resources.Near, 0)
                },
                new UINavigationController(map)
                {
                    TabBarItem = new UITabBarItem("Map", Resources.Map, 2)
                },
                timer,
                new UINavigationController(tripLog)
                {
                    TabBarItem = new UITabBarItem("Trip Log", Resources.TripLog, 3)
                },
                new UINavigationController(infoPage)
                {
                    TabBarItem = new UITabBarItem("Info", Resources.Info, 4)
                }
            };


            tabBar.SetViewControllers(tabControllers, false);

            if (localNotification)
            {
                tabBar.SelectedIndex = 2;
            }

            window.MakeKeyAndVisible();

            BikeLocation.UpdateFromWebsite(delegate {
                Util.Log("Update on startup done");
                map.RefreshPinColours();
            });

            Appirator.AppLaunched();
            Analytics.AppLaunched();

            return(true);
        }
예제 #16
0
        void CreatePhoneGui()
        {
            tabbarController = new RotatingTabBar ();
            MainView = tabbarController.View;
            window.AddSubview (MainView);

            main = new TimelineViewController (Locale.GetText ("Friends"), TweetKind.Home, false);
            mentions = new TimelineViewController (Locale.GetText ("Mentions"), TweetKind.Replies, false);
            messages = new TimelineViewController (Locale.GetText ("Messages"), TweetKind.Direct, false);
            searches = new SearchesViewController ();
            favorites = StreamedTimelineViewController.MakeFavorites ("http://api.twitter.com/1/favorites.json");

            navigationRoots = new UINavigationController [5] {
                new UINavigationController (main) {
                    TabBarItem = new UITabBarItem (Locale.GetText ("Friends"), UIImage.FromBundle ("Images/home.png"), 0),
                },
                new UINavigationController (mentions) {
                    TabBarItem = new UITabBarItem (Locale.GetText ("Mentions"), UIImage.FromBundle ("Images/replies.png"), 1)
                },
                new UINavigationController (messages) {
                    TabBarItem = new UITabBarItem (Locale.GetText ("Messages"), UIImage.FromBundle ("Images/messages.png"), 2)
                },
                new UINavigationController (favorites) {
                    TabBarItem = new UITabBarItem (Locale.GetText ("Favorites"), UIImage.FromBundle ("Images/fav.png"), 3)
                },
                new UINavigationController (searches) {
                    TabBarItem = new UITabBarItem (Locale.GetText ("Search"), UIImage.FromBundle ("Images/lupa.png"), 4)
                }
            };

            CheckDatabase ();
            tabbarController.SetViewControllers (navigationRoots, false);

            #if false && DEBUGIMAGE
            AddDebugHook ();
            #endif
        }
예제 #17
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)
        {
            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);

            //TripLog.MakeDummyData();

            Util.Log("In finished launching (with options)");

            bool localNotification = false;
            if (options != null)
            {
                if (Util.IsIOS4OrBetter)
                {
                    UILocalNotification localNotif = (UILocalNotification)options.ObjectForKey(UIApplication.LaunchOptionsLocalNotificationKey);

                    if (localNotif != null)
                    {
                        localNotification = true;
                    }
                }
            }

            Util.LogStartup();

            var bikes = BikeLocation.AllBikes;

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;
            tabBar = new UITabBarController();MainView = tabBar.View;
            window.AddSubview(MainView);

            near = new NearDialogViewController();
            map = new MapViewController();
            tripLog = new TripLogViewController();
            infoPage = new InfoViewController();

            timer = new TimerViewController{
                    TabBarItem = new UITabBarItem("Timer", Resources.Timer, 1)
                };

            tabControllers = new UIViewController[] {

                new UINavigationController(near) {
                    TabBarItem = new UITabBarItem("Near", Resources.Near, 0)
                },
                new UINavigationController(map) {
                    TabBarItem = new UITabBarItem("Map", Resources.Map, 2)
                },
                timer,
                new UINavigationController(tripLog) {
                    TabBarItem = new UITabBarItem("Trip Log", Resources.TripLog, 3)
                },
                new UINavigationController(infoPage) {
                    TabBarItem = new UITabBarItem("Info", Resources.Info, 4)
                }
            };

            tabBar.SetViewControllers(tabControllers, false);

            if (localNotification)
            {
                tabBar.SelectedIndex = 2;
            }

            window.MakeKeyAndVisible ();

            BikeLocation.UpdateFromWebsite(delegate {
                Util.Log("Update on startup done");
                map.RefreshPinColours();
            });

            Appirator.AppLaunched();
            Analytics.AppLaunched();

            return true;
        }
예제 #18
0
        private void InitializeTabBarController()
        {
            // My Books
            vc1                          = new MyBooksViewController();
            vc1.Title                    = StringRef.myBooks;
            vc1.RefreshEvent            += HandleRefreshEvent1;
            vc1.UpdateUpdatesBadgeEvent += HandleUpdateUpdatesBadgeEvent;
            vc1.UpdateMyBooksBadgeEvent += HandleUpdateMyBooksBadgeEvent;

            // Favorite
            vc2                          = new FavoriteViewController();
            vc2.Title                    = StringRef.favorites;
            vc2.RefreshEvent            += HandleRefreshEvent2;
            vc2.UpdateUpdatesBadgeEvent += HandleUpdateUpdatesBadgeEvent;

            // Updates
            vc3                          = new UpdateViewController();
            vc3.Title                    = StringRef.updates;
            vc3.RefreshEvent            += HandleRefreshEvent3;
            vc3.ClearUpdatesBadgeEvent  += HandleClearUpdatesBadgeEvent;
            vc3.UpdateUpdatesBadgeEvent += HandleUpdateUpdatesBadgeEvent;
            vc3.UpdateMyBooksBadgeEvent += HandleUpdateMyBooksBadgeEvent;

            // Available
            vc4                            = new LibraryViewController();
            vc4.Title                      = StringRef.available;
            vc4.RefreshEvent              += HandleRefreshEvent4;
            vc4.OpenBookshelfEvent        += HandleOpenBookshelfEvent;
            vc4.UpdateUpdatesBadgeEvent   += HandleUpdateUpdatesBadgeEvent;
            vc4.UpdateMyBooksBadgeEvent   += HandleUpdateMyBooksBadgeEvent;
            vc4.UpdateAvailableBadgeEvent += HandleUpdateAvailableBadgeEvent;
            vc4.UpdateTabLocationEvent    += HandleUpdateTabLocationEvent;

            // tabBarController
            tabBarController = new UITabBarController();
            tabBarController.TabBar.Translucent      = false;
            tabBarController.ViewControllerSelected += HandleViewControllerSelected;
            tabBarController.SetViewControllers(new UIViewController[] {
                vc1,
                vc2,
                vc3,
                vc4
            }, false);

            vc1.TabBarItem.Title = StringRef.myBooks;
            vc1.TabBarItem.Image = UIImage.FromBundle("Assets/Icons/tab0.png");
            vc1.TabBarItem.Tag   = 0;

            vc2.TabBarItem.Title = StringRef.favorites;
            vc2.TabBarItem.Image = UIImage.FromBundle("Assets/Icons/tab1.png");
            vc2.TabBarItem.Tag   = 1;

            vc3.TabBarItem.Title = StringRef.updates;
            vc3.TabBarItem.Image = UIImage.FromBundle("Assets/Icons/tab2.png");
            vc3.TabBarItem.Tag   = 2;

            vc4.TabBarItem.Title = StringRef.available;
            vc4.TabBarItem.Image = UIImage.FromBundle("Assets/Icons/tab3.png");
            vc4.TabBarItem.Tag   = 3;

            tabBarController.View.Hidden = true;
            this.View.AddSubview(tabBarController.View);

            List <Book> dBooks = BooksOnDeviceAccessor.GetBooks();

            if (dBooks != null)
            {
                tabBarController.SelectedIndex = 0;
            }
            else
            {
                tabBarController.SelectedIndex = 3;
            }
        }
예제 #19
0
		private void InitializeTabController ()
		{
			tabBarController = new RotatingTabBar();									
			
			navigationRoots = new UINavigationController [4] {
				buzzNavigationController,
				shareNavigationController,
				aroundNavigationController, 
				meNavigationController,
			};

			tabBarController.SetViewControllers(navigationRoots, true);
			tabBarController.ViewControllerSelected += HandleTabBarControllerViewControllerSelected;
			_currentNavControler = buzzNavigationController;
						
			window.AddSubview (tabBarController.View);					
		}