Example #1
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;
        }
Example #2
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);
        }