Exemple #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)
        {
            try
            {
                // create a new window instance based on the screen size
                window = new UIWindow (UIScreen.MainScreen.Bounds);

                Menu = new SimpleSlideoutNavigationController ();
                HomeViewController homeController = CreateHomeController ();
                Menu.MainViewController = new MainNavigationController (homeController, Menu);
                Menu.MenuViewController = new MenuNavigationController (new TagViewController (homeController), Menu) {
                    NavigationBarHidden = true,
                };

                // If you have defined a root view controller, set it here:
                window.RootViewController = Menu;
                UpdateTheme ();

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

                return true;
            }
            catch (Exception ex)
            {
                Insights.Report (ex);
                throw;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoTouch.SlideoutNavigation.MainNavigationController"/> class.
 /// </summary>
 /// <param name="rootViewController">Root view controller.</param>
 /// <param name="slideoutNavigationController">Slideout navigation controller.</param>
 /// <param name="openMenuButton">Open menu button.</param>
 public MainNavigationController(UIViewController rootViewController, SlideoutNavigationController slideoutNavigationController, UIBarButtonItem openMenuButton)
     : base(rootViewController)
 {
     _slideoutNavigationController = slideoutNavigationController;
     openMenuButton.Clicked       += (s, e) => _slideoutNavigationController.Open(true);
     rootViewController.NavigationItem.LeftBarButtonItem = openMenuButton;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoTouch.SlideoutNavigation.MainNavigationController"/> class.
 /// </summary>
 /// <param name="rootViewController">Root view controller.</param>
 /// <param name="slideoutNavigationController">Slideout navigation controller.</param>
 /// <param name="openMenuButton">Open menu button.</param>
 public MainNavigationController(UIViewController rootViewController, SlideoutNavigationController slideoutNavigationController, UIBarButtonItem openMenuButton)
     : base(rootViewController)
 {
     _slideoutNavigationController = slideoutNavigationController;
     openMenuButton.Clicked += (s, e) => _slideoutNavigationController.Open(true);
     rootViewController.NavigationItem.LeftBarButtonItem = openMenuButton;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoTouch.SlideoutNavigation.MenuNavigationController"/> class.
 /// </summary>
 /// <param name="rootViewController">Root view controller.</param>
 /// <param name="slideoutNavigationController">Slideout navigation controller.</param>
 public MainNavigationController(UIViewController rootViewController, SlideoutNavigationController slideoutNavigationController)
     : base(rootViewController)
 {
     _slideoutNavigationController = slideoutNavigationController;
     var openMenuButton = new UIBarButtonItem(UIImage.FromBundle("MonoTouch.SlideoutNavigation.bundle/three_lines"),
         UIBarButtonItemStyle.Plain, (s, e) => _slideoutNavigationController.Open(true));
     rootViewController.NavigationItem.LeftBarButtonItem = openMenuButton;
 }
        private MXSlideoutContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
            : base(theApp)
        {
            _appDelegate = appDelegate;
            Menu = new SlideoutNavigationController();

            _window = window;
            _window.RootViewController = Menu;
        }
Exemple #6
0
 public MenuController(SlideoutNavigationController menu,IDictionaryStorage storage)
     : base(UITableViewStyle.Plain,new RootElement(""))
 {
     this.menu = menu;
     this.storage = storage;
     homeControlled = new HomeScreen (storage);
     updateController = new SourceTypeController (storage);
     menu.TopView = storage.Empty () ? updateController : homeControlled;
 }
        //
        // 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);
            Menu = new SlideoutNavigationController();
            Menu.TopView = new HomeViewController();
            Menu.MenuView = new DummyController();

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

            return true;
        }
        private void DoTransition(UIViewController fromViewController, IBaseViewModel fromViewModel, UIViewController toViewController, IBaseViewModel toViewModel)
        {
            var toViewDismissCommand = toViewModel.DismissCommand;

//            if (toViewController is SettingsViewController)
//            {
//                toViewController.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(CodeFramework.iOS.Images.Cancel, UIBarButtonItemStyle.Plain, (s, e) => toViewDismissCommand.ExecuteIfCan());
//                toViewDismissCommand.Subscribe(__ => toViewController.DismissViewController(true, null));
//                fromViewController.PresentViewController(new UINavigationController(toViewController), true, null);
//            }
            if (toViewController is AccountsView)
            {
                var rootNav = (UINavigationController)UIApplication.SharedApplication.Delegate.Window.RootViewController;
                toViewController.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(Images.Cancel, UIBarButtonItemStyle.Plain, (s, e) => toViewDismissCommand.ExecuteIfCan());
                toViewDismissCommand.Subscribe(_ => rootNav.DismissViewController(true, null));
                rootNav.PresentViewController(new UINavigationController(toViewController), true, null);
            }
//            else if (fromViewController is RepositoriesViewController)
//            {
//                fromViewController.NavigationController.PresentViewController(toViewController, true, null);
//            }
            else if (toViewController is MenuView)
            {
                var nav = ((UINavigationController)UIApplication.SharedApplication.Delegate.Window.RootViewController);
                var slideout = new SlideoutNavigationController();
                slideout.MenuViewController = new MenuNavigationController(toViewController, slideout);
                UIView.Transition(nav.View, 0.1, UIViewAnimationOptions.BeginFromCurrentState | UIViewAnimationOptions.TransitionCrossDissolve,
                    () => nav.PushViewController(slideout, false), null);
            }
            else if (toViewController is NewAccountView && fromViewController is StartupView)
            {
                toViewDismissCommand.Subscribe(_ => toViewController.DismissViewController(true, null));
                fromViewController.PresentViewController(new UINavigationController(toViewController), true, null);
            }
            else if (fromViewController is MenuView)
            {
                fromViewController.NavigationController.PushViewController(toViewController, true);
            }
            else if (toViewController is LanguagesView && fromViewController is RepositoriesTrendingView)
            {
                toViewDismissCommand.Subscribe(_ => fromViewController.DismissViewController(true, null));
                toViewController.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, (s, e) => toViewDismissCommand.ExecuteIfCan());
                var ctrlToPresent = new UINavigationController(toViewController);
                ctrlToPresent.TransitioningDelegate = new SlideDownTransition();
                fromViewController.PresentViewController(ctrlToPresent, true, null);
            }
            else
            {
                toViewDismissCommand.Subscribe(_ => toViewController.NavigationController.PopToViewController(fromViewController, true));
                fromViewController.NavigationController.PushViewController(toViewController, true);
            }
        }
        //
        // 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);

            Menu = new SlideoutNavigationController();
			Menu.MainViewController = new MainNavigationController(new HomeViewController(), Menu);
			Menu.MenuViewController = new MenuNavigationController(new DummyControllerLeft(), Menu) { NavigationBarHidden = true };
//
            window.RootViewController = Menu;
            window.MakeKeyAndVisible ();

            return true;
        }
        public MainTabController()
        {
            news = new SlideoutNavigationController ();

            // instantiate the table view from the storyboard
            UIStoryboard board = UIStoryboard.FromName ("MainStoryboard", null);
            // dashboard if some favourites saved otherwise the plain
            // table view
            if (AppDelegate.IsLoggedIn()) {
                tableNews = (HomeController)board.InstantiateViewController ("homecontroller");
            }
            else {
                tableNews = (NewsController)board.InstantiateViewController ("newscontroller");
            }

            var menu = (MenuController)board.InstantiateViewController ("menucontroller");
            news.TopView = tableNews;
            news.MenuViewLeft = menu;

            pictures = new SlideoutNavigationController ();
            //tablePictures = (PicturesController)board.InstantiateViewController ("picturesController");
            tablePictures = new PicturesController ();
            menu = (MenuController)board.InstantiateViewController ("menucontroller");
            pictures.TopView = tablePictures;
            pictures.MenuViewLeft = menu;
            pictures.DisplayNavigationBarOnLeftMenu = false;

            liveScore = new UINavigationController ();
            LiveScoreViewController liveScoreScroll = (LiveScoreViewController)board.InstantiateViewController ("lscv");
            liveScore.PushViewController(liveScoreScroll, false);
            if (((AppDelegate)UIApplication.SharedApplication.Delegate).IsSeven) {
                liveScore.NavigationBar.BarTintColor = UIColor.Black;
            }
            else {
                liveScore.NavigationBar.SetBackgroundImage (UIImage.FromFile ("./Assets/navbar.png"),
                                                            MonoTouch.UIKit.UIBarMetrics.Default);
            }

            video = new SlideoutNavigationController ();
            menu = (MenuController)board.InstantiateViewController ("menucontroller");
            video.TopView = new VideoController ();
            video.MenuViewLeft = menu;
            video.DisplayNavigationBarOnLeftMenu = false;

            ViewControllers = new UIViewController[] { news, pictures, video, liveScore };
        }
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            Menu = new SlideoutNavigationController ();
            Menu.SlideHeight = 9999f;
            Menu.TopView = new PlayBackScreen (0, "No title", "No Author");
            Menu.MenuViewLeft = new BookShelfFinal();
            Menu.LeftMenuButtonText = "Book Shelf";
            Menu.BackgroundColor = UIColor.FromHSB (22, 100, 20);
            Menu.RightMenuEnabled = false;
            Menu.SlideWidth = 260f; // allows you to determine how much of the menu is vissible 260
            Menu.SlideSpeed = 0.3f; // how many seconds you want the slide transition to take

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

            return true;
        }
Exemple #12
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);

            if (!HLDatabase.DbExisted)
            {
                var dataLines = File.ReadLines("Data/CropData.txt");
                HLDatabase.CreateDummyData(dataLines);
            }

            MainScreen = new SlideoutNavigationController();
            MainScreen.TopView = new CalcDVC();
            MainScreen.MenuView = new SlideoutMenuDVC();

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

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

            return true;
        }
Exemple #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoTouch.SlideoutNavigation.MenuNavigationController"/> class.
 /// </summary>
 /// <param name="rootViewController">Root view controller.</param>
 /// <param name="slideoutNavigationController">Slideout navigation controller.</param>
 public MenuNavigationController(UIViewController rootViewController, SlideoutNavigationController slideoutNavigationController)
     : base(rootViewController)
 {
     _slideoutNavigationController = slideoutNavigationController;
 }
        public Pubnub_MessagingSub (string channelName, string cipher, bool enableSSL, Pubnub pubnub) 
            : base (UITableViewStyle.Grouped, null)
        {
            Channel = channelName;
            Ssl = enableSSL;
            Cipher = cipher;
            this.pubnub = pubnub;

            string strSsl = "";
            if (Ssl) {
                strSsl = "SSL,";
            }
            
            string strCip = "";
            if (!String.IsNullOrWhiteSpace (Cipher)) {
                strCip = "Cipher";
            }
            
            string head = String.Format ("{0} {1}", strSsl, strCip);

            Section secAction = new Section ();
            
            bool bIphone = true;
            
            int viewHeight = 70;
            
            secAction.HeaderView = CreateHeaderView(viewHeight);
            
            secOutput = new Section("Output");
            
            root = new RootElement (head) {
                secAction,
                secOutput
            };

            Root = root;
            dvc = new DialogViewController (root, true);
            var tap = new UITapGestureRecognizer ();
            tap.AddTarget (() =>{
                dvc.View.EndEditing (true);
            });
            dvc.View.AddGestureRecognizer (tap);

            tap.CancelsTouchesInView = false;
            dvc.NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Cancel, delegate {
                pubnub.EndPendingRequests ();
                AppDelegate.navigation.PopToRootViewController(true);
            });
            Menu = new SlideoutNavigationController ();
            Menu.TopView = dvc;

            Menu.MenuViewLeft = new LeftNavController (Menu, this);

            AppDelegate.navigation.PushViewController (Menu, true);
            Menu.ShowMenuLeft ();
            newChannels.Text = Channel;
        }
 public LeftNavController (SlideoutNavigationController menu, Pubnub_MessagingSub pubnub_MessagingSub) 
     : base(UITableViewStyle.Plain,new RootElement(""))
 {
     this.pubnub_MessagingSub = pubnub_MessagingSub;
     this.menu = menu;
 }
 public PanDelegate (SlideoutNavigationController controller)
 {
     _controller = controller;
 }
Exemple #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoTouch.SlideoutNavigation.MenuNavigationController"/> class.
 /// </summary>
 /// <param name="rootViewController">Root view controller.</param>
 /// <param name="slideoutNavigationController">Slideout navigation controller.</param>
 public MainNavigationController(UIViewController rootViewController, SlideoutNavigationController slideoutNavigationController)
     : this(rootViewController, slideoutNavigationController,
            new UIBarButtonItem(UIImage.FromBundle("MonoTouch.SlideoutNavigation.bundle/three_lines"), UIBarButtonItemStyle.Plain, (s, e) => {}))
 {
 }
        public override void Show(MvxViewModelRequest request)
        {
            var viewCreator = Mvx.Resolve<IMvxTouchViewCreator>();
            var view = viewCreator.CreateView(request);
            var uiView = view as UIViewController;

            if (uiView == null)
                throw new InvalidOperationException("Asking to show a view which is not a UIViewController!");

            if (uiView is IMvxModalTouchView)
            {
                _currentModal = (IMvxModalTouchView)uiView;
                var modalNavigationController = new UINavigationController(uiView);
                modalNavigationController.NavigationBar.Translucent = false;
                modalNavigationController.Toolbar.Translucent = false;
                uiView.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(Theme.CurrentTheme.CancelButton, UIBarButtonItemStyle.Plain, (s, e) =>
                {
                    var vm = ((IMvxModalTouchView)uiView).ViewModel;
                    Mvx.Resolve<Cirrious.MvvmCross.Plugins.Messenger.IMvxMessenger>().Publish(new CodeFramework.Core.Messages.CancelationMessage(vm));
                    modalNavigationController.DismissViewController(true, null);
                    _currentModal = null;
                });
                PresentModalViewController(modalNavigationController, true);
            }
            else if (uiView is StartupView)
            {
                _window.RootViewController = uiView;
            }
            else if (uiView is AccountsView)
            {
                _slideoutController = null;
                _generalNavigationController = new UINavigationController(uiView);
                _generalNavigationController.NavigationBar.Translucent = false;
                _generalNavigationController.Toolbar.Translucent = false;

                Transition(_generalNavigationController, UIViewAnimationTransition.FlipFromRight);
            }
            else if (uiView is MenuBaseViewController)
            {
                _slideoutController = new SimpleSlideoutNavigationController();
                _slideoutController.MenuViewController = new MenuNavigationController(uiView, _slideoutController);
                uiView.NavigationController.NavigationBar.Translucent = false;
                uiView.NavigationController.Toolbar.Translucent = false;
                uiView.NavigationController.NavigationBar.BarTintColor = UIColor.FromRGB(50, 50, 50);
                Transition(_slideoutController, UIViewAnimationTransition.FlipFromLeft);
            }
            else
            {
                if (request.PresentationValues != null && request.PresentationValues.ContainsKey(PresentationValues.SlideoutRootPresentation))
                {
                    var mainNavigationController = new MainNavigationController(uiView, _slideoutController, new UIBarButtonItem(Theme.CurrentTheme.ThreeLinesButton, UIBarButtonItemStyle.Plain, (s, e) => _slideoutController.Open(true)));
                    _generalNavigationController = mainNavigationController;
                    _slideoutController.SetMainViewController(mainNavigationController, true);

                    //_generalNavigationController.NavigationBar.BarTintColor = Theme.CurrentTheme.ApplicationNavigationBarTint;
                    _generalNavigationController.NavigationBar.Translucent = false;
                    _generalNavigationController.Toolbar.Translucent = false;
                }
                else
                {
                    _generalNavigationController.PushViewController(uiView, true);
                }
            }
        }
 private void GoToMenu(object o)
 {
     var vc = new MenuViewController();
     var slideoutController = new SlideoutNavigationController();
     slideoutController.MenuViewController = new MenuNavigationController(vc, slideoutController);
     (UIApplication.SharedApplication.Delegate as AppDelegate).Do(y => y.Presenter.SlideoutNavigationController = slideoutController);
     vc.ViewModel.GoToDefaultTopView.Execute(null);
     slideoutController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve;
     PresentViewController(slideoutController, true, null);
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="MonoTouch.SlideoutNavigation.MenuNavigationController"/> class.
		/// </summary>
		/// <param name="rootViewController">Root view controller.</param>
		/// <param name="slideoutNavigationController">Slideout navigation controller.</param>
		public MenuNavigationController(UIViewController rootViewController, SlideoutNavigationController slideoutNavigationController)
			: base(rootViewController)
		{
			_slideoutNavigationController = slideoutNavigationController;
		}
Exemple #21
0
 public PanDelegate(SlideoutNavigationController controller)
 {
     _controller = controller;
 }
        public override void Show(MvxViewModelRequest request)
        {
            var uiView = this.CreateViewControllerFor(request) as UIViewController;

            if (uiView == null)
                throw new InvalidOperationException("Asking to show a view which is not a UIViewController!");

            if (uiView is IMvxModalIosView)
            {
                if (_currentModal != null)
                    throw new InvalidOperationException("Cannot have multiple modals");

                _currentModal = (IMvxModalIosView)uiView;
                var modalNavigationController = new UINavigationController(uiView);
                modalNavigationController.NavigationBar.Translucent = false;
                modalNavigationController.Toolbar.Translucent = false;
                uiView.NavigationItem.LeftBarButtonItem = new UIBarButtonItem(Theme.CurrentTheme.CancelButton, UIBarButtonItemStyle.Plain, (s, e) =>
                {
                    var vm = ((IMvxModalIosView)uiView).ViewModel;
                    Mvx.Resolve<MvvmCross.Plugins.Messenger.IMvxMessenger>().Publish(new CodeFramework.Core.Messages.CancelationMessage(vm));
                    modalNavigationController.DismissViewController(true, null);
                    _currentModal = null;
                });
                PresentModalViewController(modalNavigationController, true);
            }
            else if (uiView is StartupView)
            {
                Transition(uiView);
            }
            else if (uiView is LoginView && _slideoutController == null)
            {
                var nav = new UINavigationController(uiView);
                _window.RootViewController.PresentViewController(nav, true, null);
            }
            else if (uiView is MenuBaseViewController)
            {
                _slideoutController = new SlideoutNavigationController();
                _slideoutController.MenuViewController = new MenuNavigationController(uiView, _slideoutController);
                uiView.NavigationController.NavigationBar.SetBackgroundImage(null, UIBarMetrics.Default);
                uiView.NavigationController.NavigationBar.Translucent = false;
                uiView.NavigationController.Toolbar.Translucent = false;
                uiView.NavigationController.NavigationBar.BarTintColor = UIColor.FromRGB(50, 50, 50);
                Transition(_slideoutController);
            }
            else
            {
                if (request.PresentationValues != null && request.PresentationValues.ContainsKey(PresentationValues.SlideoutRootPresentation))
                {
                    var mainNavigationController = new MainNavigationController(uiView, _slideoutController, new UIBarButtonItem(Theme.CurrentTheme.ThreeLinesButton, UIBarButtonItemStyle.Plain, (s, e) => _slideoutController.Open(true)));
                    _generalNavigationController = mainNavigationController;
                    _slideoutController.SetMainViewController(mainNavigationController, true);


                    //_generalNavigationController.NavigationBar.BarTintColor = Theme.CurrentTheme.ApplicationNavigationBarTint;
                    _generalNavigationController.NavigationBar.Translucent = false;
                    _generalNavigationController.Toolbar.Translucent = false;
                }
                else
                {
                    _generalNavigationController.PushViewController(uiView, true);
                }
            }
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="MonoTouch.SlideoutNavigation.MenuNavigationController"/> class.
		/// </summary>
		/// <param name="rootViewController">Root view controller.</param>
		/// <param name="slideoutNavigationController">Slideout navigation controller.</param>
		public MainNavigationController(UIViewController rootViewController, SlideoutNavigationController slideoutNavigationController)
            : this(rootViewController, slideoutNavigationController, 
                new UIBarButtonItem(UIImage.FromBundle("MonoTouch.SlideoutNavigation.bundle/three_lines"), UIBarButtonItemStyle.Plain, (s, e) => {}))
		{
		}