示例#1
0
 public static void ReturnToMainScreen(UINavigationController navigation)
 {
     UIView.BeginAnimations(null,IntPtr.Zero);
     UIView.SetAnimationDuration(0.4);
     UIView.SetAnimationTransition(UIViewAnimationTransition.CurlDown,navigation.View,true);
     UIView.CommitAnimations();
 }
示例#2
0
		public override bool FinishedLaunching(UIApplication app, NSDictionary options)
		{
			window = new UIWindow(UIScreen.MainScreen.Bounds);

			var controller = new UIViewController();
			var view = new UIView (UIScreen.MainScreen.Bounds);
			view.BackgroundColor = UIColor.White;
			controller.View = view;

			controller.NavigationItem.Title = "SignalR Client";

			var textView = new UITextView(new CGRect(0, 0, 320, view.Frame.Height - 0));
			view.AddSubview (textView);


			navController = new UINavigationController (controller);

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

			if (SIGNALR_DEMO_SERVER == "http://YOUR-SERVER-INSTANCE-HERE") {
				textView.Text = "You need to configure the app to point to your own SignalR Demo service.  Please see the Getting Started Guide for more information!";
				return true;
			}
			
			var traceWriter = new TextViewWriter(SynchronizationContext.Current, textView);

			var client = new CommonClient(traceWriter);
			client.RunAsync(SIGNALR_DEMO_SERVER);

			return 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)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// load the appropriate UI, depending on whether the app is running on an iPhone or iPad
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				var controller = new RootViewController ();
				navigationController = new UINavigationController (controller);
				window.RootViewController = navigationController;
			} else {
				var masterViewController = new RootViewController ();
				var masterNavigationController = new UINavigationController (masterViewController);
				var detailViewController = new DetailViewController ();
				var detailNavigationController = new UINavigationController (detailViewController);
				
				splitViewController = new UISplitViewController ();
				splitViewController.WeakDelegate = detailViewController;
				splitViewController.ViewControllers = new UIViewController[] {
					masterNavigationController,
					detailNavigationController
				};
				
				window.RootViewController = splitViewController;
			}

			// make the window visible
			window.MakeKeyAndVisible ();
			
			return true;
		}
示例#4
0
 public static void SendSms(UINavigationController navigation)
 {
     UIView.BeginAnimations(null,IntPtr.Zero);
     UIView.SetAnimationDuration(0.4);
     UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromRight, navigation.View, true);
     UIView.CommitAnimations();
 }
示例#5
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create our window
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			
			// are we running an iPhone or an iPad?
			DetermineCurrentDevice ();

			// instantiate our main navigatin controller and add it's view to the window
			mainNavController = new UINavigationController ();
			
			switch (CurrentDevice)
			{
				case DeviceType.iPhone:
					iPhoneHome = new HandlingRotation.Screens.iPhone.Home.HomeScreen ();
					mainNavController.PushViewController (iPhoneHome, false);
					break;
				
				case DeviceType.iPad:
					iPadHome = new HandlingRotation.Screens.iPad.Home.HomeScreenPad ();
					mainNavController.PushViewController (iPadHome, false);
					break;
			}

			window.RootViewController = mainNavController;

			return true;
		}
示例#6
0
 public ItemPage(UINavigationController c, Item item)
 {
     // trace event
     TraceHelper.AddMessage("Item: constructor");
     controller = c;
     ThisItem = item;
 }
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			// create our nav controller
			navController = new UINavigationController ();

			// create our home controller based on the device
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone();
			} else {
//				homeViewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null);
			}
			
			// Styling
			UINavigationBar.Appearance.TintColor = UIColor.FromRGB (38, 117 ,255); // nice blue
			UITextAttributes ta = new UITextAttributes();
			ta.Font = UIFont.FromName ("AmericanTypewriter-Bold", 0f);
			UINavigationBar.Appearance.SetTitleTextAttributes(ta);
			ta.Font = UIFont.FromName ("AmericanTypewriter", 0f);
			UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal);
			

			// push the view controller onto the nav controller and show the window
			navController.PushViewController(homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
		/// <summary>
		/// Shows the search controller.
		/// </summary>
		public void ShowSearchController ()
		{
			// Build an instance of the Search Results View Controller from the Storyboard
			ResultsController = Storyboard.InstantiateViewController (SearchResultsID) as SearchResultsViewController;
			if (ResultsController == null)
				throw new Exception ("Unable to instantiate a SearchResultsViewController.");

			// Create an initialize a new search controller
			var searchController = new UISearchController (ResultsController) {
				SearchResultsUpdater = ResultsController,
				HidesNavigationBarDuringPresentation = false
			};

			// Set any required search parameters
			searchController.SearchBar.Placeholder = "Enter keyword (e.g. coffee)";

			// The Search Results View Controller can be presented as a modal view
			// PresentViewController (searchController, true, null);

			// Or in the case of this sample, the Search View Controller is being
			// presented as the contents of the Search Tab directly. Use either one
			// or the other method to display the Search Controller (not both).
			var container = new UISearchContainerViewController (searchController);
			var navController = new UINavigationController (container);
			AddChildViewController (navController);
			View.Add (navController.View);
		}
示例#9
0
文件: Timeline.cs 项目: 21Off/21Off
		public TimelineViewController (FilterType filterType, bool pushing, UINavigationController msp, 
		                               IMapLocationRequest maplocationRequest) 
			: base(pushing)
		{
			_FilterType = filterType;
			_MapLocationRequest = maplocationRequest;
			
			ShowLoadMorePhotos = true;

			this.TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
			this.TableView.BackgroundColor = new UIColor (226f, 231f, 237f, 1f);
			this.TableView.AllowsSelection = false;

			switch(filterType)
			{
				case FilterType.Friends:
					TableView.BackgroundView = new UIImageView(Graphics.GetImgResource("fond1"));
					break;
				case FilterType.Recent:
					TableView.BackgroundView = new UIImageView(Graphics.GetImgResource("fond2"));
					break;
				case FilterType.All:
					TableView.BackgroundView = new UIImageView(Graphics.GetImgResource("fond3"));
					break;
			}

			_list = new List<ImageInfo>();
			_MSP = msp;
			
			OnGestSwipe += HandleOnSwipe;
		}
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			MenuViewController menuViewController = new MenuViewController(UITableViewStyle.Grouped);
			DetailsViewController detailsViewController = new DetailsViewController();
			UINavigationController navController = new UINavigationController (detailsViewController);

			SlideMenuController slideMenuViewController = new SlideMenuController();
			slideMenuViewController.SetContentViewController (navController);
			slideMenuViewController.SetLeftMenuViewController (menuViewController);

			UINavigationController cont = new UINavigationController (new MenuViewController (UITableViewStyle.Plain));

			slideMenuViewController.SetRightMenuViewController (cont);

			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
				slideMenuViewController.WidthOfPortraitContentViewVisible = 300f;
				slideMenuViewController.WidthOfLandscapeContentViewVisible = 556f;
			}

			window.RootViewController = slideMenuViewController;

			window.BackgroundColor = UIColor.White;
			window.MakeKeyAndVisible ();			
			return true;
		}
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			// create our nav controller
			navController = new UINavigationController ();

			// create our home controller based on the device
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				homeViewController = new Screens.HomeScreen();
			} else {
// sample does not contain an iPad UI
//				homeViewController = new Screens.iPadHomeScreen ();
			}
			
			// push the view controller onto the nav controller and show the window
			navController.PushViewController(homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return 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);

			var root = new RootElement("MBProgressHUD")
			{
				new Section ("Samples")
				{
					new StringElement ("Simple indeterminate progress", ShowSimple),
					new StringElement ("With label", ShowWithLabel),
					new StringElement ("With details label", ShowWithDetailsLabel),
					new StringElement ("Determinate mode", ShowWithLabelDeterminate),
					new StringElement ("Annular determinate mode", ShowWIthLabelAnnularDeterminate),
					new StringElement ("Custom view", ShowWithCustomView),
					new StringElement ("Mode switching", ShowWithLabelMixed),
					new StringElement ("Using handlers", ShowUsingHandlers),
					new StringElement ("On Window", ShowOnWindow),
					new StringElement ("NSURLConnection", ShowUrl),
					new StringElement ("Dim background", ShowWithGradient),
					new StringElement ("Text only", ShowTextOnly),
					new StringElement ("Colored", ShowWithColor),
				}
			};

			dvcDialog = new DialogViewController(UITableViewStyle.Grouped, root, false);
			navController = new UINavigationController(dvcDialog);

			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
示例#13
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);

			var web = new WebElement ();
			web.HtmlFile = "instructions";

			var root = new RootElement ("Kannada Keyboard") {
				new Section{
					new UIViewElement("Instruction", web.View, false)
				}
			};
		
			var dv = new DialogViewController (root) {
				Autorotate = true
			};
			var navigation = new UINavigationController ();
			navigation.PushViewController (dv, true);				

			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			window.AddSubview (navigation.View);
			
			return true;
		}
示例#14
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
            MainWindow = new UIWindow(UIScreen.MainScreen.Bounds);

            var currentHomeUiViewController = new SplashViewController();
            RootNavigationController = new UINavigationController(currentHomeUiViewController);
            MainWindow.RootViewController = RootNavigationController;

            var titleTextAttributes = new UITextAttributes();
            titleTextAttributes.TextColor = UIColor.FromRGB(25, 83, 135);
            titleTextAttributes.TextShadowColor = UIColor.Clear;
            titleTextAttributes.Font = UIFont.SystemFontOfSize(16);

            //			if (IsIOS5OrGreater)
            //			{
            //				UINavigationBar.Appearance.SetTitleTextAttributes(titleTextAttributes);
            //				UINavigationBar.Appearance.SetBackgroundImage(UIImage.FromBundle("/Images/top_bar_bg"), UIBarMetrics.Default);
            //			}
            //

            MainWindow.MakeKeyAndVisible();

            return true;
        }
示例#15
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);

            viewController = new UINavigationController ();
            viewController.PushViewController(new MainScreenGroup(), true);
            viewController.NavigationBar.Opaque = true;

            window.MakeKeyAndVisible ();

            #if LITE
            AdManager.LoadBanner();
            #endif

            // On iOS5 we use the new window.RootViewController, on older versions, we add the subview
            if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
                window.RootViewController = viewController;
            else
                window.AddSubview (viewController.View);

            #if LITE
            Apprater = new Appirater(527002436);
            #else
            Apprater = new Appirater(526844540);
            #endif
            Apprater.AppLaunched();
            return true;
        }
	private void Core()
	{
		var rootStyles = new RootElement ("Add New Styles");

		var styleHeaderElement = new Section ("Style Header");
		var manualEntryRootElement = new RootElement ("Manual Entry");
		styleHeaderElement.Add (manualEntryRootElement);

		var quickFillElement = new Section ("Quick Fill");
		var womenTops = new RootElement ("Womens Tops");
		var womenOutwear = new RootElement ("Womens Outerwear");
		var womenSweaters = new RootElement ("Womens Sweaters");
		quickFillElement.AddAll (new [] { womenTops, womenOutwear, womenSweaters });

		rootStyles.Add (new [] { styleHeaderElement, quickFillElement });

		// DialogViewController derives from UITableViewController, so access all stuff from it
		var rootDialog = new DialogViewController (rootStyles);
		rootDialog.NavigationItem.BackBarButtonItem = new UIBarButtonItem("Back", UIBarButtonItemStyle.Bordered, null);

		EventHandler handler = (s, e) => {
			if(_popover != null)
				_popover.Dismiss(true);
		};

		rootDialog.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Bordered, handler), true);
		rootDialog.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("Create", UIBarButtonItemStyle.Bordered, null), true);

		NavigationPopoverContentViewController = new UINavigationController (rootDialog);
	}
        //
        // 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);

            MainPageViewController viewController = new MainPageViewController();

            //---- instantiate a new navigation controller
            var rootNavigationController = new UINavigationController();

            //---- add the home screen to the navigation controller
            // (it'll be the top most screen)
            rootNavigationController.PushViewController(viewController, false);

            //---- set the root view controller on the window. the nav
            // controller will handle the rest
            this.window.RootViewController = rootNavigationController;
            this.window.MakeKeyAndVisible ();
            return true;

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

            return true;
        }
		protected async override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			navigation = NavigationController;

			window = new UIWindow(UIScreen.MainScreen.Bounds);

			//This is the class which actually implements the component a couple of elements to make it work
			viewController = new JSQmessages(); 


			//sender is a public field of JSQmessages and it is populated using the public fields we defined in the orginal forms ChatPage.
			viewController.sender = new User (){ Id = ChatPage.senderID, DisplayName = ChatPage.senderName };

			viewController.View.Frame = this.View.Frame;

			navigationController = new UINavigationController();
			navigationController.PushViewController(viewController, false);

			AddChildViewController (viewController);

			/*the Frame is smaller than the entire screen, this lets us still retain the original Navigation bar from Xamarin Forms, 
			 * so it's easy to dismiss the page from the view hierarchy if we retain the navbar that forms created for us */
			viewController.View.Frame = new CGRect(this.View.Frame.X,this.View.Frame.Y,this.View.Bounds.Width,this.View.Bounds.Height - 64f);
			this.View.AddSubview (viewController.View);
			this.DidMoveToParentViewController (viewController); 



		} 
        //
        // 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);
            runner = new TouchRunner (window);

            // register every tests included in the main application/assembly
            runner.Add (System.Reflection.Assembly.GetExecutingAssembly ());

            UINavigationController navController = new UINavigationController (runner.GetViewController ());

            navController.NavigationBar.BarTintColor = UIColor.FromRGB(0/255.0f,145/255.0f,211/255.0f);
            navController.NavigationBar.TintColor = UIColor.White;
            navController.NavigationBar.TitleTextAttributes = new UIStringAttributes()
            {
                ForegroundColor = UIColor.White,
            };

            window.RootViewController = navController;

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

            return true;
        }
示例#20
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)
        {

            UITabBarController tabBarController;

            window = new UIWindow (UIScreen.MainScreen.Bounds);

            viewController = new Pubnub_MessagingMain ();

            var dv = new Pubnub_MessagingMain () {
                Autorotate = true
            };

            navigation = new UINavigationController ();
            navigation.PushViewController (dv, true);

            window = new UIWindow (UIScreen.MainScreen.Bounds);
            window.MakeKeyAndVisible ();
            window.RootViewController = navigation;    
            /*            if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
                window.RootViewController = navigation;    
            else
                window.AddSubview (navigation.View);*/

            return true;
        }
示例#21
0
		public NewAccountViewController (AppDelegateIPhone appDel, UINavigationController vc) : base("NewAccountViewController", null)
		{
			_AppDel = appDel;
			_vc = vc;
			
			this.root = CreateRoot ();
		}
示例#22
0
 public QCTest1Navigator(UINavigationController navigationContext)
 {
     this.navigationContext = navigationContext;
     // TODO: If your app requires multiple navigation contexts, add additional constructor parameters
     // to pass them in, and then let the navigator manage when which context should be used.
     // E.g. you could use this in a universal app running in PAD mode when you have a master view and a detail view on the same screen.
 }
示例#23
0
        public BigItemMasterView()
            : base()
        {
            masterView = new BigItemsScreen();
            detailview = new BigItemDetailScreen();

            masterView.ActivateDetail += (object sender, BigItemDetailClickedEventArgs e) => detailview.ShowDetails (e.lagerobject);

            detailview.BigItemSaved += (object sender, BigItemSavedEventArgs e) => masterView.Refresh ();

            //			detailview.Derezzy += (object sender, DerezLargeObjectEventArgs e) => {
            //                detailnav.PopViewControllerAnimated(true);
            //                masterView.Refresh();
            //            };

            detailview.GotPicture += (object sender, GotPictureEventArgs e) => masterView.Refresh ();

            masternav = new UINavigationController();
            masternav.PushViewController(masterView, false);

            detailnav = new UINavigationController();
            detailnav.PushViewController(detailview, false);

            //always last
            ViewControllers = new UIViewController[] {masternav, detailnav};
        }
示例#24
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);

			// We use NSUserDefaults to store a bool value if we are tracking the user or not 
			var optionsDict = NSDictionary.FromObjectAndKey (new NSString ("YES"), new NSString (AllowTrackingKey));
			NSUserDefaults.StandardUserDefaults.RegisterDefaults (optionsDict);

			// User must be able to opt out of tracking
			GAI.SharedInstance.OptOut = !NSUserDefaults.StandardUserDefaults.BoolForKey (AllowTrackingKey);

			// Initialize Google Analytics with a 5-second dispatch interval (Use a higher value when in production). There is a
			// tradeoff between battery usage and timely dispatch.
			GAI.SharedInstance.DispatchInterval = 5;
			GAI.SharedInstance.TrackUncaughtExceptions = true;

			Tracker = GAI.SharedInstance.GetTracker ("CuteAnimals", TrackingId);

			viewController = new DVCMenu ();
			navController = new UINavigationController (viewController);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            try
            {
                window = new UIWindow(UIScreen.MainScreen.Bounds);

                SettingsMobile.Instance.User = new SqlFactory().CreateTables().GetProfile();
                if (SettingsMobile.Instance.User == null)
                    SettingsMobile.Instance.User = new Portable.Account.UserMobile();

                if (SettingsMobile.Instance.User.LastMobileLoginDate.AddDays(30) > DateTime.UtcNow)
                    SettingsMobile.Instance.User.IsLoggedIn = false;

                viewController = new MainViewController();
                var rootNavigationController = new UINavigationController();
                rootNavigationController.PushViewController(viewController, false);
                window.RootViewController = rootNavigationController;

                window.MakeKeyAndVisible();
               
            }
            catch (Exception exception)
            {
                ErrorHandler.Save(exception, MobileTypeEnum.iPhone);
            }
            return true;
        }
示例#26
0
        public TabBar(MXTouchContainer touchContainer)
        {
            Model = new Object();

            // define view size
            View.Frame = new RectangleF (0, 20, 320, 460);

            // setup view controllers for each tab
            var navBarTint = UIColor.FromRGB(0, 63, 107);
            var rootTabBarCtrls = new List<UIViewController>(3);

            var navCtrl = new UINavigationController();
            navCtrl.NavigationBar.TintColor = navBarTint;
            navCtrl.TabBarItem = new UITabBarItem("Contacts", UIImage.FromBundle("images/contacts.png"), 0);
            rootTabBarCtrls.Add(navCtrl);

            navCtrl = new UINavigationController();
            navCtrl.NavigationBar.TintColor = navBarTint;
            navCtrl.TabBarItem = new UITabBarItem("Calendar", UIImage.FromBundle("images/cal.png"), 0);
            rootTabBarCtrls.Add(navCtrl);

            navCtrl = new UINavigationController();
            navCtrl.NavigationBar.TintColor = navBarTint;
            navCtrl.TabBarItem = new UITabBarItem("Tasks", UIImage.FromBundle("images/filecab.png"), 0);
            rootTabBarCtrls.Add(navCtrl);

            SetViewControllers(rootTabBarCtrls.ToArray(), false);
            Delegate = new TabBarDelegate();
        }
示例#27
0
		/// <summary>
		/// Invoked when it comes time to set the root so the child classes can create their own menus
		/// </summary>
		private void OnCreateMenu(RootElement root)
		{
            var addGistSection = new Section();
            root.Add(addGistSection);
            addGistSection.Add(new MenuElement("New Gist", () => {
                var gistController = new CreateGistController();
                gistController.Created = (id) => {
                    NavigationController.PushViewController(new GistInfoController(id), true);
                };
                var navController = new UINavigationController(gistController);
                PresentViewController(navController, true, null);
            }, Images.Buttons.NewGist));

            var gistMenuSection = new Section() { HeaderView = new MenuSectionView("Gists") };
            root.Add(gistMenuSection);
            gistMenuSection.Add(new MenuElement("My Gists", () => NavigationController.PushViewController(new MyGistsController(), true), Images.Buttons.MyGists));
            gistMenuSection.Add(new MenuElement("Starred", () => NavigationController.PushViewController(new StarredGistsController(), true), Images.Buttons.Star2));
            gistMenuSection.Add(new MenuElement("Public", () => NavigationController.PushViewController(new PublicGistsController(), true), Images.Buttons.Public));

//            var labelSection = new Section() { HeaderView = new MenuSectionView("Tags") };
//            root.Add(labelSection);
//            labelSection.Add(new MenuElement("Add New Tag", () => { }, null));

            var moreSection = new Section() { HeaderView = new MenuSectionView("Info") };
            root.Add(moreSection);
            moreSection.Add(new MenuElement("About", () => NavigationController.PushViewController(new AboutController(), true), Images.Buttons.Info));
            moreSection.Add(new MenuElement("Feedback & Support", () => { 
                var config = UserVoice.UVConfig.Create("http://gistacular.uservoice.com", "lYY6AwnzrNKjHIkiiYbbqA", "9iLse96r8yki4ZKknfHKBlWcbZAH9g8yQWb9fuG4");
                UserVoice.UserVoice.PresentUserVoiceInterface(this, config);
            }, Images.Buttons.Feedback));
            moreSection.Add(new MenuElement("Logout", Logout, Images.Buttons.Logout));
		}
示例#28
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            UINavigationBar.Appearance.TintColor = UIColor.FromRGB (29, 131, 219);

            window = new UIWindow (UIScreen.MainScreen.Bounds);
            window.BackgroundColor = UIColor.White;
            window.Bounds = UIScreen.MainScreen.Bounds;

            var u = new TaskListScreen();
            navController = new UINavigationController();
            navController.PushViewController (u, false);

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

            // DROPBOX STUFF
            // The account manager stores all the account info. Create this when your app launches
            var manager = new DBAccountManager (DropboxSyncKey, DropboxSyncSecret);
            DBAccountManager.SharedManager = manager;

            var account = manager.LinkedAccount;
            if (account != null) {
                SetupDropbox ();
            } else
                manager.LinkFromController (window.RootViewController);
            //--

            return true;
        }
示例#29
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)
        {
            // Prevent screen lock
            app.IdleTimerDisabled = true;

            // Load settings
            var conn = NSUserDefaults.StandardUserDefaults.StringForKey("connType");
            var connType = conn == null ? ConnectionType.Registrar : (ConnectionType) Enum.Parse(typeof(ConnectionType), conn);
            var connString = NSUserDefaults.StandardUserDefaults.StringForKey("connString");

            // Init config controller
            var webController = new iOSWebViewController(connType, connString);

            // init the root controller
            var rootController = new UINavigationController();
            rootController.NavigationBarHidden = true;
            rootController.PushViewController(webController, false);

            // init the window, add the root controller
            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.RootViewController = rootController;
            window.MakeKeyAndVisible();

            return true;
        }
示例#30
0
		public UIViewController GetViewer (object value, bool createInspector)
		{
			var vc = value as UIViewController;
			if (vc != null)
				return vc;
			
			var sv = GetSpecialView (value);

			vc = sv as UIViewController;
			if (vc != null && vc.ParentViewController == null) {
				return vc;
			}

			var v = sv as UIView;
			if (v != null && v.Superview == null) {
				vc = new UIViewController ();
				vc.View = v;
				return vc;
			}

			if (createInspector) {
				vc = new UINavigationController (new ObjectInspector(value));
				return vc;
			}

			return null;
		}
示例#31
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            ThemeManager.ApplyTheme();
            ViewModel.ViewModelBase.Init();
            application.IdleTimerDisabled = true;

            ServiceLocator.Instance.Add <IAuthentication, Authentication>();
            ServiceLocator.Instance.Add <ILogger, PlatformLogger>();
            ServiceLocator.Instance.Add <IOBDDevice, OBDDevice>();

            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
            SQLitePCL.CurrentPlatform.Init();

#if !XTC
            if (!string.IsNullOrWhiteSpace(Logger.HockeyAppiOS))
            {
                Setup.EnableCustomCrashReporting(() =>
                {
                    var manager = BITHockeyManager.SharedHockeyManager;
                    manager.Configure(Logger.HockeyAppiOS);
                    manager.StartManager();
                    manager.Authenticator.AuthenticateInstallation();
                    AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
                                                                  Setup.ThrowExceptionAsNative(e.ExceptionObject);
                    TaskScheduler.UnobservedTaskException += (sender, e) =>
                                                             Setup.ThrowExceptionAsNative(e.Exception);
                });
            }
#endif

            if (!Settings.Current.IsLoggedIn)
            {
#if XTC
                var viewController = UIStoryboard.FromName("Main", null)
                                     .InstantiateViewController("loginViewController");
                Window.RootViewController = viewController;
#else
                if (Settings.Current.FirstRun)
                {
                    var viewController = UIStoryboard.FromName("Main", null)
                                         .InstantiateViewController("gettingStartedViewController");
                    var navigationController = new UINavigationController(viewController);
                    Window.RootViewController = navigationController;

                    Settings.Current.FirstRun = false;
                }
                else
                {
                    var viewController = UIStoryboard.FromName("Main", null)
                                         .InstantiateViewController("loginViewController");
                    Window.RootViewController = viewController;
                }
#endif
            }
            else
            {
                //When the first scre app is launched after user has logged in, initialize the processor that manages connection to OBD Device and to the IOT Hub
                MyDriving.Services.OBDDataProcessor.GetProcessor().Initialize(ViewModel.ViewModelBase.StoreManager);

                var tabBarController = Window.RootViewController as UITabBarController;
                tabBarController.SelectedIndex = 1;
            }

#if XTC
            Xamarin.Calabash.Start();
#endif

            return(true);
        }
示例#32
0
        protected void ShowFilterController(FilterViewController filter)
        {
            var nav = new UINavigationController(filter);

            PresentViewController(nav, true, null);
        }
示例#33
0
 public new IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     return(null);
 }
示例#34
0
 public GestureDelegate(UINavigationController parent, Func <bool> shouldPop)
 {
     _parent    = parent;
     _shouldPop = shouldPop;
 }
示例#35
0
 public void SelectController(UINavigationController nav, UIViewController vc)
 {
     nav.PushViewController(vc, true);
 }
示例#36
0
 /// <summary>
 /// Implementation of the card reader
 /// </summary>
 public ReaderImplementation()
 {
     navigationController = FindNavigationController();
     IsCameraAvailable    = UIImagePickerController.IsSourceTypeAvailable(UIImagePickerControllerSourceType.Camera);
 }
示例#37
0
        public RunsSplitViewController(RunsTableViewController ranSessions, UINavigationController nav, UINavigationController imagesTableViewNavController)
        {
            runsTableViewController    = ranSessions;
            navigationController       = nav;
            imagesNavigationController = imagesTableViewNavController;

            ViewControllers = new UIViewController[] { navigationController, imagesNavigationController };
        }
示例#38
0
            public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
            {
                if (!fromViewController.GetType().IsSubclassOf(typeof(UICollectionViewController)))
                {
                    return(null);
                }
                if (!toViewController.GetType().IsSubclassOf(typeof(UICollectionViewController)))
                {
                    return(null);
                }
                if (!transitionController.HasActiveInteraction)
                {
                    return(null);
                }

                transitionController.NavigationOperation = operation;
                return(transitionController);
            }
示例#39
0
 public static void PSPDFFixNavigationBarForNavigationControllerAnimated(UINavigationController navController, bool animated)
 {
     _PSPDFFixNavigationBarForNavigationControllerAnimated(navController.Handle, Convert.ToByte(animated));
 }
示例#40
0
 public ImagePickerProvider(UINavigationController controller, ApplicationContext context)
 {
     _controller = controller;
     _context    = context;
 }
示例#41
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            Window.BackgroundColor = UIColor.White;

            var view1 = new UIView()
            {
                BackgroundColor = UIColor.LightGray
            };

            view1.AddConstraint(NSLayoutConstraint.Create(view1, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 200));
            var view2 = new UIView()
            {
                BackgroundColor = UIColor.White
            };

            view2.AddConstraint(NSLayoutConstraint.Create(view2, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 200));
            var view3 = new UIView()
            {
                BackgroundColor = UIColor.LightGray
            };

            view3.AddConstraint(NSLayoutConstraint.Create(view3, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 200));
            var view4 = new UIView()
            {
                BackgroundColor = UIColor.White
            };

            view4.AddConstraint(NSLayoutConstraint.Create(view4, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 200));
            var view5 = new UIView()
            {
                BackgroundColor = UIColor.LightGray
            };

            view5.AddConstraint(NSLayoutConstraint.Create(view5, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 200));

            var viewController = new SwipeUpScrollViewController();

            viewController.MainView = new UILabel {
                Text = "This is the main view.", TextAlignment = UITextAlignment.Center
            };
            viewController.SwipeUpViewList = new UIView[] { view1, view2, view3, view4, view5 };

            viewController.TapToRaiseEnabled       = true;
            viewController.MinScale                = 0.9f;
            viewController.SwipeUpScrollViewHeight = 100;
            viewController.CoverStatusBar          = false;
            viewController.CoverNavigationBar      = true;

            var navigationController = new UINavigationController(viewController);
            var barButtonItem        = new UIBarButtonItem();

            barButtonItem.Title = "Test";
            navigationController.NavigationItem.LeftBarButtonItem = barButtonItem;
            viewController.Title      = "SwipeUpScrollView";
            Window.RootViewController = navigationController;

            viewController.ScrollView.Scrolled += (sender, e) =>
            {
                viewController.MainView.Alpha = -viewController.ScrollView.ContentOffset.Y / viewController.MainView.Frame.Height;
            };

            Window.MakeKeyAndVisible();

            return(true);
        }
示例#42
0
 public override IUIViewControllerInteractiveTransitioning GetInteractionControllerForAnimationController(UINavigationController navigationController, IUIViewControllerAnimatedTransitioning animationController)
 {
     if (animationController == transitionController)
     {
         return(transitionController);
     }
     return(null);
 }
 public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
 {
     _oldDelegate?.WillShowViewController(navigationController, viewController, animated);
 }
示例#44
0
 internal void UpdateRootViewController(UIViewController vc)
 {
     viewController            = vc;
     navigationController      = new UINavigationController(viewController);
     Window.RootViewController = navigationController;
 }
示例#45
0
        /// <summary>
        ///
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // browsers tab
            // in this case, we create a navigation controller and then add our screen
            // to that
            browsersTabNavController                  = new UINavigationController();
            browsersTabNavController.TabBarItem       = new UITabBarItem();
            browsersTabNavController.TabBarItem.Title = "Browsers";
            browsersHome = new Browsers.BrowsersHome();
            browsersTabNavController.PushViewController(browsersHome, false);

            // maps tab
            mapsTabNavController                  = new UINavigationController();
            mapsTabNavController.TabBarItem       = new UITabBarItem();
            mapsTabNavController.TabBarItem.Title = "Maps";
            mapsHome = new Maps.MapsHome();
            mapsTabNavController.PushViewController(mapsHome, false);

            // search
            searchScreen            = new Search.SearchScreen();
            searchScreen.TabBarItem = new UITabBarItem(UITabBarSystemItem.Search, 1);

            // custom nav bar
            customizeNavBarNavController                  = new UINavigationController();
            customizeNavBarNavController.TabBarItem       = new UITabBarItem();
            customizeNavBarNavController.TabBarItem.Title = "Nav";
            customizingNavBarScreen = new CustomizingNavBar.CustomizingNavBarScreen();
            customizeNavBarNavController.PushViewController(customizingNavBarScreen, false);

            // set a badge, just for fun
            customizeNavBarNavController.TabBarItem.BadgeValue = "3";


            // create our array of controllers
            var viewControllers = new UIViewController[] {
                browsersTabNavController,
                mapsTabNavController,
                searchScreen,
                customizeNavBarNavController,
                new ExtraScreens.CustomizableTabScreen()
                {
                    Number = "1"
                },
                new ExtraScreens.CustomizableTabScreen()
                {
                    Number = "2"
                },
                new ExtraScreens.CustomizableTabScreen()
                {
                    Number = "3"
                },
                new ExtraScreens.CustomizableTabScreen()
                {
                    Number = "4"
                },
                new ExtraScreens.CustomizableTabScreen()
                {
                    Number = "5"
                }
            };

            // create an array of customizable controllers from just the
            // ones we want to customize.
            var customizableControllers = new UIViewController[] {
                viewControllers[2],
                viewControllers[3],
                viewControllers[4],
                viewControllers[5],
                viewControllers[6]
            };

            // attach the view controllers
            this.ViewControllers = viewControllers;

            // tell the tab bar which controllers are allowed to customize. if we
            // don't set this, it assumes all controllers are customizable.
            CustomizableViewControllers = customizableControllers;

            // set our selected item
            SelectedViewController = browsersTabNavController;
        }
        public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
        {
            if (!_self.DisableTransition)
            {
                //At this point the property TargetPage refers to the view we are pushing or popping
                //This view is not yet visible in our app but the variable is already set
                var viewsToAnimate = new List <(WeakReference ToView, WeakReference FromView, bool IsLightsnapshot)>();

                IReadOnlyList <TransitionDetail> transitionStackTo;
                IReadOnlyList <TransitionDetail> transitionStackFrom;

                if (operation == UINavigationControllerOperation.Push)
                {
                    transitionStackFrom = _self.TransitionMap.GetMap(_self.PropertiesContainer, _self.SelectedGroup);
                    transitionStackTo   = _self.TransitionMap.GetMap(_self.LastPageInStack, null);
                }
                else
                {
                    transitionStackFrom = _self.TransitionMap.GetMap(_self.LastPageInStack, null);
                    transitionStackTo   = _self.TransitionMap.GetMap(_self.PropertiesContainer, _self.SelectedGroup);
                }

                if (transitionStackFrom != null)
                {
                    //Get all the views with transitions in the destination page
                    //With this, we are sure to dont start transitions with no mathing transitions in destination
                    foreach (var toView in transitionStackTo)
                    {
                        //Using LastOrDefault because the CollectionView created the first element twice
                        //and then hide the first without detaching the effect.
                        var fromView = transitionStackFrom.FirstOrDefault(x => x.TransitionName == toView.TransitionName);

                        if (fromView == null)
                        {
                            Debug.WriteLine($"The from view for {toView.TransitionName} does not exists in stack, ignoring the transition");
                            continue;
                        }

                        viewsToAnimate.Add((toView.NativeView, fromView.NativeView, fromView.IsLightSnapshot));
                    }
                }

                //IF we have views to animate, proceed with custom transition and edge gesture
                //No view to animate = standard push & pop
                if (viewsToAnimate.Any())
                {
                    //deactivate normal pop gesture and activate the custom one suited for the shared transitions
                    if (operation == UINavigationControllerOperation.Push)
                    {
                        _self.AddInteractiveTransitionRecognizer();
                    }

                    return(new NavigationTransition(viewsToAnimate, operation, _self, _self.EdgeGestureRecognizer));
                }
            }

            /*
             * IMPORTANT!
             *
             * standard push & pop
             * i dont use my custom edgeswipe because it does not play well with standard pop
             * Doing this work here, is good for push.
             * When doing the custom, interactive, pop i need to double check the custom gesture later
             * (see comments in UIGestureRecognizerState.Ended)
             */

            _self.RemoveInteractiveTransitionRecognizer();
            return(null);
        }
 internal NavigationService(UINavigationController navigationController)
 {
     NavigationController = navigationController;
 }
 public override IUIViewControllerInteractiveTransitioning GetInteractionControllerForAnimationController(
     UINavigationController navigationController, IUIViewControllerAnimatedTransitioning animationController)
 {
     return(_self.PercentDrivenInteractiveTransition);
 }
示例#49
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);
            root   = new WelcomeController();
            nav    = new UINavigationController(root);

            nav.NavigationBar.Translucent = false;

            var defaultNavBar = new UINavigationBar();

            defaultNavBar.TintColor = UIColor.FromRGBA(0, 51, 102, 1f);

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

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

            // Below are instructions for initial setup, lines marked as optional
            // are options, lines marked as required are required
            // Throughout the code, you can search for [OPTIMIZELY] to find reference code
            // related to Optimizely
            // All lines that say [OPTIMIZELY] (REQUIRED) are necessary for you to
            // get started!

            // [OPTIMIZELY] (OPTIONAL) Add this line of code to debug issues.  Please note that this line of code
            // should not be included when your app is in production
            OptimizelyiOS.Optimizely.SharedInstance.VerboseLogging = true;

            // [OPTIMIZELY] (OPTIONAL) Add this line of code if you would like to enable "Edit Mode" in your live app
            // Please note that adding this line will allow anyone to edit your app with
            // Optimizely in the app store
            // OptimizelyiOS.Optimizely.EnableGestureInAppStoreApp();

            // [OPTIMIZELY] (OPTIONAL) Customize network call timing (By default network calls are made every 2 minutes)
            // OptimizelyiOS.Optimizely.SharedInstance.DispatchInterval = 120;

            // [OPTIMIZELY] (REQUIRED) Replace this line with your API token, and don't forget to go to
            // your target (i.e. the blue icon at the top that says TutorialApp) > Info > URL Types
            // Paste your Project ID there (e.g. it should look like optly123456, replace 123456 with your project id)
            // Replace @"AAMseu0A6cJKXYL7RiH_TgxkvTRMOCvS~123456" with your API Token from your Optimizely Dashboard
            // optimizely.com/dashboard

            // [OPTIMIZELY] (OPTIONAL) Google Analytics Example
            // https://help.optimizely.com/hc/en-us/articles/204628347
            // Initialize Google Analytics prior to startOptimizely e.g.
            // id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"YOUR_GA_TRACKING_ID"];
            var options = launchOptions ?? new NSDictionary();

            OptimizelyiOS.Optimizely.StartOptimizelyWithAPIToken(@"AAM7hIkAowOlMm2aH9e1cYv_AztnhY25~3391160510", options);

            // [OPTIMIZELY] (OPTIONAL) Mixpanel Integration Instructions and order
            // Optimizely Mixpanel Integration goes here
            // Mixpanel Activation goes here

            // [OPTIMIZELY] (DEBUG) Subscribe to the OptimizelyExperimentVisitedNotification to know when an experiment
            // is visited, which means the visitor has see the experience you created
            NSNotificationCenter.DefaultCenter.AddObserver(this, new ObjCRuntime.Selector("ExperimentReceivedNotification"), OptimizelyiOS.Constants.OptimizelyExperimentVisitedNotification, null);

            // [OPTIMIZELY] (DEBUG) Subscribe to the OptimizelyNewDataFileLoadedNotification to know when
            // a new Optimizely data file has been updated
            NSNotificationCenter.DefaultCenter.AddObserver(this, new ObjCRuntime.Selector("DataFileReceivedNotification"), OptimizelyiOS.Constants.OptimizelyNewDataFileLoadedNotification, null);

            // [OPTIMIZELY] (DEBUG) Subscribe to the OptimizelyGoalTriggeredNotification to know when
            // a goal has triggered
            NSNotificationCenter.DefaultCenter.AddObserver(this, new ObjCRuntime.Selector("GoalReceivedNotification"), OptimizelyiOS.Constants.OptimizelyGoalTriggeredNotification, null);

            return(true);
        }
示例#50
0
 public override IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
 {
     return(new OnboardingTransitionAnimator());
 }
示例#51
0
 public NavItemTableSource(UINavigationController navigationController, List <NavItemGroup> items)
 {
     navItems = items;
     this.navigationController = navigationController;
 }
示例#52
0
 public TableSource(List <Country> items, UINavigationController navigationController)
 {
     TableItems     = items;
     _navController = navigationController;
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _navController = TabBarController.NavigationController;

            _gridDelegate = new CollectionViewFlowDelegate(feedCollection, _presenter);
            _gridDelegate.ScrolledToBottom   += ScrolledToBottom;
            _gridDelegate.IsGrid              = false;
            _collectionViewSource             = new ProfileCollectionViewSource(_presenter, _gridDelegate);
            _collectionViewSource.IsGrid      = false;
            _collectionViewSource.CellAction += CellAction;
            _collectionViewSource.TagAction  += TagAction;

            _refreshControl = new UIRefreshControl();
            _refreshControl.ValueChanged += OnRefresh;

            feedCollection.Source = _collectionViewSource;
            feedCollection.RegisterClassForCell(typeof(NewFeedCollectionViewCell), nameof(NewFeedCollectionViewCell));
            feedCollection.RegisterClassForCell(typeof(LoaderCollectionCell), nameof(LoaderCollectionCell));
            feedCollection.Add(_refreshControl);
            feedCollection.Delegate             = _gridDelegate;
            feedCollection.DelaysContentTouches = false;

            _sliderGridDelegate = new SliderCollectionViewFlowDelegate(sliderCollection, _presenter);
            _sliderGridDelegate.ScrolledToBottom += ScrolledToBottom;

            var _sliderCollectionViewSource = new SliderCollectionViewSource(_presenter, _sliderGridDelegate);

            sliderCollection.DecelerationRate = UIScrollView.DecelerationRateFast;
            sliderCollection.ShowsHorizontalScrollIndicator = false;

            sliderCollection.SetCollectionViewLayout(new SliderFlowLayout()
            {
                MinimumLineSpacing      = 10,
                MinimumInteritemSpacing = 0,
                ScrollDirection         = UICollectionViewScrollDirection.Horizontal,
                SectionInset            = new UIEdgeInsets(0, 15, 0, 15),
            }, false);

            sliderCollection.Source = _sliderCollectionViewSource;
            sliderCollection.RegisterClassForCell(typeof(LoaderCollectionCell), nameof(LoaderCollectionCell));
            sliderCollection.RegisterClassForCell(typeof(SliderFeedCollectionViewCell), nameof(SliderFeedCollectionViewCell));

            sliderCollection.DelaysContentTouches = false;

            _sliderCollectionViewSource.CellAction += CellAction;
            _sliderCollectionViewSource.TagAction  += TagAction;
            sliderCollection.Delegate = _sliderGridDelegate;

            SliderAction += (isOpening) =>
            {
                if (!sliderCollection.Hidden)
                {
                    sliderCollection.ScrollEnabled = !isOpening;
                }
            };

            if (TabBarController != null)
            {
                TabBarController.NavigationController.NavigationBar.TintColor    = Constants.R15G24B30;
                TabBarController.NavigationController.NavigationBar.BarTintColor = UIColor.White;
                TabBarController.NavigationController.SetNavigationBarHidden(true, false);
            }

            ((MainTabBarController)TabBarController).SameTabTapped += SameTabTapped;

            SetNavBar();
            GetPosts();
        }
示例#54
0
 public void Initialize(UINavigationController navigationController)
 {
     this.navigationController = navigationController;
 }
示例#55
0
        public IUIViewControllerAnimatedTransitioning GetAnimationControllerForOperation(UINavigationController navigationController, UINavigationControllerOperation operation, UIViewController fromViewController, UIViewController toViewController)
        {
            if ((fromViewController is ResponseDetailsViewController || toViewController is ResponseDetailsViewController) &&
                (operation == UINavigationControllerOperation.Pop || operation == UINavigationControllerOperation.Push))
            {
                return(new ResponseDetailsTransitionAnimator
                {
                    IsPresenting = operation == UINavigationControllerOperation.Push,
                    WantsInteractiveStart = false,
                });
            }

            return(null);
        }
 public void UpdateLayout(UINavigationController controller)
 {
 }
示例#57
0
 public NewsTableSource(NewsModel[] news, UINavigationController controller)
 {
     _news       = news;
     _controller = controller;
 }
示例#58
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            UIInterfaceOrientation orientation = UIApplication.SharedApplication.StatusBarOrientation;
            float width = (float)View.Frame.Width;

            float height = (float)View.Frame.Height;

            if (orientation == UIInterfaceOrientation.LandscapeLeft || orientation == UIInterfaceOrientation.LandscapeRight)
            {
                width  = (float)View.Frame.Height;
                height = (float)View.Frame.Width;
            }

            recognizedTextLabel      = new UILabel(new CGRect(button_gap, 30, width, 20));
            recognizedTextLabel.Text = "Recognized Text:";
            View.Add(recognizedTextLabel);
            recognizedText                 = new UITextView(new CGRect(button_gap, header_height, width - button_gap * 2, height / 4));
            recognizedText.Editable        = false;
            recognizedText.Font            = UIFont.FromName("Courier", 18);
            recognizedText.Text            = "";
            recognizedText.BackgroundColor = UIColor.Gray;
            recognizedText.TextColor       = UIColor.White;
            View.Add(recognizedText);
            inkView             = new InkView();
            inkView.Frame       = new CGRect(button_gap, header_height + height / 4 + button_gap, width - button_gap * 2, height - bottom_gap - (height / 4) - header_height - button_gap);
            inkView.ContentMode = UIViewContentMode.Redraw;
            View.Add(inkView);

            inkView.OnReturnGesture += () => recognizedText.Text = inkView.Recognize(true);
            inkView.OnReturnGesture += () => inkView.cleanView(true);
            inkView.OnCutGesture    += () => inkView.cleanView(true);

            float x = (width - (button_width * 4 + button_gap * 3)) / 2;

            recognizeAllButton       = new UIButton(UIButtonType.Custom);
            recognizeAllButton.Frame = new CGRect(x, height - bottom_gap, button_width, button_height);
            recognizeAllButton.SetTitle("Recognize", UIControlState.Normal);
            recognizeAllButton.Font = UIFont.SystemFontOfSize(button_font_size);
            recognizeAllButton.SetTitleColor(UIColor.Blue, UIControlState.Normal);
            recognizeAllButton.SetTitleColor(UIColor.White, UIControlState.Highlighted);
            recognizeAllButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                recognizedText.Text = inkView.Recognize(false);
            };
            View.Add(recognizeAllButton);
            x                += (button_gap + button_width);
            clearButton       = new UIButton(UIButtonType.Custom);
            clearButton.Frame = new CGRect(x, height - bottom_gap, button_width, button_height);
            clearButton.SetTitle("Clear", UIControlState.Normal);
            clearButton.Font = UIFont.SystemFontOfSize(button_font_size);
            clearButton.SetTitleColor(UIColor.Blue, UIControlState.Normal);
            clearButton.SetTitleColor(UIColor.White, UIControlState.Highlighted);
            clearButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                inkView.cleanView(true);
            };
            View.Add(clearButton);

            x += (button_gap + button_width);
            languageButton       = new UIButton(UIButtonType.Custom);
            languageButton.Frame = new CGRect(x, height - bottom_gap, button_width, button_height);
            languageButton.SetTitle("Language", UIControlState.Normal);
            languageButton.Font = UIFont.SystemFontOfSize(button_font_size);
            languageButton.SetTitleColor(UIColor.Blue, UIControlState.Normal);
            languageButton.SetTitleColor(UIColor.White, UIControlState.Highlighted);
            languageButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                var actionSheet = new UIActionSheet("Select Language:", null, "Cancel", null,
                                                    new [] { "English", "English UK", "German", "French", "Spanish", "Portuguese", "Brazilian", "Dutch", "Italian", "Finnish", "Swedish", "Norwegian", "Danish", "Indonesian" });
                actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
                    switch (b.ButtonIndex)
                    {
                    case 0:
                        WritePadAPI.language = WritePadAPI.LanguageType.en;
                        break;

                    case 1:
                        WritePadAPI.language = WritePadAPI.LanguageType.en_uk;
                        break;

                    case 2:
                        WritePadAPI.language = WritePadAPI.LanguageType.de;
                        break;

                    case 3:
                        WritePadAPI.language = WritePadAPI.LanguageType.fr;
                        break;

                    case 4:
                        WritePadAPI.language = WritePadAPI.LanguageType.es;
                        break;

                    case 5:
                        WritePadAPI.language = WritePadAPI.LanguageType.pt_PT;
                        break;

                    case 6:
                        WritePadAPI.language = WritePadAPI.LanguageType.pt_BR;
                        break;

                    case 7:
                        WritePadAPI.language = WritePadAPI.LanguageType.nl;
                        break;

                    case 8:
                        WritePadAPI.language = WritePadAPI.LanguageType.it;
                        break;

                    case 9:
                        WritePadAPI.language = WritePadAPI.LanguageType.fi;
                        break;

                    case 10:
                        WritePadAPI.language = WritePadAPI.LanguageType.sv;
                        break;

                    case 11:
                        WritePadAPI.language = WritePadAPI.LanguageType.nb;
                        break;

                    case 12:
                        WritePadAPI.language = WritePadAPI.LanguageType.da;
                        break;

                    case 13:
                        WritePadAPI.language = WritePadAPI.LanguageType.id;
                        break;
                    }
                    WritePadAPI.recoFree();
                    WritePadAPI.recoInit();
                    WritePadAPI.initializeFlags();
                    inkView.cleanView(true);
                    recognizedTextLabel.Text = "Language: " + " (" + WritePadAPI.getLanguageName() + ")";
                };
                actionSheet.ShowInView(View);
            };
            View.Add(languageButton);

            x                  += (button_gap + button_width);
            optionsButton       = new UIButton(UIButtonType.Custom);
            optionsButton.Frame = new CGRect(x, height - bottom_gap, button_width, button_height);
            optionsButton.SetTitle("Options", UIControlState.Normal);
            optionsButton.Font = UIFont.SystemFontOfSize(button_font_size);
            optionsButton.SetTitleColor(UIColor.Blue, UIControlState.Normal);
            optionsButton.SetTitleColor(UIColor.White, UIControlState.Highlighted);
            optionsButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                OptionsViewControllerController optionsController = new OptionsViewControllerController();
                UINavigationController          navController     = new UINavigationController(optionsController);
                navController.ModalPresentationStyle = UIModalPresentationStyle.FormSheet;
                PresentViewController(navController, true, null);
            };
            View.Add(optionsButton);

            recognizedTextLabel.Text = "Language: " + " (" + WritePadAPI.getLanguageName() + ")";
        }
示例#59
0
 public AboutController1(UINavigationController navCtrl) : base("AboutController", null)
 {
     NavCtrl = navCtrl;
 }
 public TblViajesSource(List <Viaje> viajes, UINavigationController navigationController, UIStoryboard storyboard)
 {
     _viajes = viajes;
     _navigationController = navigationController;
     _storyboard           = storyboard;
 }