Example #1
0
        public static void SetAppearance()
        {
            UINavigationBar.Appearance.BarTintColor = RDRed;
            UINavigationBar.Appearance.TintColor    = UIColor.White;

            var textAttributes = new UITextAttributes
            {
                TextColor = UIColor.White
            };

            UINavigationBar.Appearance.SetTitleTextAttributes(textAttributes);

            UITabBar.Appearance.BackgroundColor = UIColor.White;
            UITabBar.Appearance.BarTintColor    = UIColor.White;
            UITabBar.Appearance.TintColor       = RDBlue;

            UITableView.Appearance.BackgroundColor = UIColor.White;
            UITableView.Appearance.TintColor       = RDBlue;
            UITableView.Appearance.SeparatorColor  = RDBlue;

            UIPageControl.Appearance.BackgroundColor = UIColor.White;
            UIPageControl.Appearance.CurrentPageIndicatorTintColor = RDBlue;
            UIPageControl.Appearance.PageIndicatorTintColor        = UIColor.LightGray;

            UIButton.Appearance.TintColor = RDBlue;
        }
Example #2
0
        private void SetupNavigationItems()
        {
            // Add back button
            using (
                var closeImage =
                    UIImage.FromBundle("Icons/close.png").ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal))
            {
                _closeButton = new UIBarButtonItem(closeImage, UIBarButtonItemStyle.Plain, null, null);
            }

            NavigationController.InteractivePopGestureRecognizer.Delegate = new SwipeGestureDelegate();
            NavigationItem.SetLeftBarButtonItem(_closeButton, true);

            // Add Post button
            _postMenuItem = new UIBarButtonItem
            {
                Title = Settings.GetResource(ResKeys.mobile_post_btn_post),
            };

            var icoFontAttribute = new UITextAttributes {
                Font = Appearance.Fonts.LatoBoldWithSize(24), TextColor = Appearance.Colors.BisnerBlue
            };

            _postMenuItem.SetTitleTextAttributes(icoFontAttribute, UIControlState.Application);
            _postMenuItem.Style = UIBarButtonItemStyle.Done;

            // Post indicator
            _postingIndicator = new UIActivityIndicatorView {
                Color = Appearance.Colors.BisnerBlue
            };
            _postIndicatorItem = new UIBarButtonItem(_postingIndicator);
            _postingIndicator.StartAnimating();

            NavigationItem.SetRightBarButtonItems(new[] { _postMenuItem }, true);
        }
        private void SetNavBarItems()
        {
            var navPage = this.Element as NavigationPage;

            if (navPage == null)
            {
                return;
            }

            var textAttributes = new UITextAttributes()
            {
                Font = UIFont.FromName(customFontName, customFontSize)
            };

            var textAttributesHighlighted = new UITextAttributes()
            {
                TextColor = Color.Black.ToUIColor(),
                Font      = UIFont.FromName(customFontName, customFontSize)
            };

            UIBarButtonItem.Appearance.SetTitleTextAttributes(textAttributes,
                                                              UIControlState.Normal);
            UIBarButtonItem.Appearance.SetTitleTextAttributes(textAttributesHighlighted,
                                                              UIControlState.Highlighted);
        }
Example #4
0
        private void SetupButtons()
        {
            if (_picker.AllowsMultipleSelection)
            {
                var doneTitle = _picker.CustomDoneButtonTitle ?? "picker.navigation.done-button".Translate(defaultValue: "Done");
                NavigationItem.RightBarButtonItem = new UIBarButtonItem(doneTitle,
                                                                        UIBarButtonItemStyle.Done,
                                                                        FinishPickingAssets);

                NavigationItem.RightBarButtonItem.Enabled = !_picker.AutoDisableDoneButton || _picker.SelectedAssets.Any();
            }
            else
            {
                var cancelTitle = _picker.CustomCancelButtonTitle ?? "picker.navigation.cancel-button".Translate(defaultValue: "Cancel");
                NavigationItem.RightBarButtonItem = new UIBarButtonItem(cancelTitle,
                                                                        UIBarButtonItemStyle.Done,
                                                                        Dismiss);
            }
            if (_picker.UseCustomFontForNavigationBar)
            {
                var barButtonItemAttributes = new UITextAttributes {
                    Font = UIFont.FromName(_picker.PickerFontName, _picker.PickerFontHeaderSize)
                };
                NavigationItem.RightBarButtonItem.SetTitleTextAttributes(barButtonItemAttributes, UIControlState.Normal);
                NavigationItem.RightBarButtonItem.SetTitleTextAttributes(barButtonItemAttributes, UIControlState.Highlighted);
            }
        }
Example #5
0
        public Agenda(IntPtr handle) : base(handle)
        {
            Title = NSBundle.MainBundle.LocalizedString("Notícias", "Notícias");
            var attrs = new UITextAttributes()
            {
                TextColor = UIColor.FromRGB(168, 0, 0),
            };

            UITabBarItem.Appearance.SetTitleTextAttributes(attrs, state: UIControlState.Normal);


            View.BackgroundColor = UIColor.White;

            webView = new UIWebView(View.Bounds);

            webView.ScrollView.ContentInset = new UIEdgeInsets(0, 0, 45, 0);
            View.AddSubview(webView);

            webView.ScalesPageToFit = true;


            if (!Reachability.IsHostReachable("tum.pt"))
            {
                Reachability.InternetConnectionStatus();
                UIAlertView alert = new UIAlertView();
                alert.Title = "Sem ligação à rede";
                alert.AddButton("Continuar");
                alert.Message = "Não conseguirá usar a aplicação sem conexão à rede.";
                alert.Show();
            }
            else
            {
                webView.LoadRequest(new NSUrlRequest(new NSUrl(url)));
            }
        }
Example #6
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);
        }
        protected void ChangeRightBarButtonFontToBold()
        {
            if (NavigationItem == null || NavigationItem.RightBarButtonItem == null)
            {
                return;
            }

            var rightBarButtonFont = UIFont.FromName(FontName.HelveticaNeueMedium, 34 / 2);
            var textColor          = Theme.ButtonTextColor;

            var buttonTextColor = new UITextAttributes()
            {
                Font             = rightBarButtonFont,
                TextColor        = textColor,
                TextShadowColor  = UIColor.Clear,
                TextShadowOffset = new UIOffset(0, 0)
            };
            var selectedButtonTextColor = new UITextAttributes()
            {
                Font             = rightBarButtonFont,
                TextColor        = textColor.ColorWithAlpha(0.5f),
                TextShadowColor  = UIColor.Clear,
                TextShadowOffset = new UIOffset(0, 0)
            };

            NavigationItem.RightBarButtonItem.SetTitleTextAttributes(buttonTextColor, UIControlState.Normal);
            NavigationItem.RightBarButtonItem.SetTitleTextAttributes(selectedButtonTextColor, UIControlState.Highlighted);
            NavigationItem.RightBarButtonItem.SetTitleTextAttributes(selectedButtonTextColor, UIControlState.Selected);
        }
        void SetSelectedTextColor()
        {
            var attr = new UITextAttributes();

            attr.TextColor = Element.SelectedTextColor.ToUIColor();
            nativeControl.SetTitleTextAttributes(attr, UIControlState.Selected);
        }
        void ConfigureCustomBackgroundSegmentedControl()
        {
            CustomBackgroundSegmentedControl.SelectedSegment = 2;
            CustomBackgroundSegmentedControl.SetBackgroundImage (UIImage.FromBundle ("stepper_and_segment_background"), UIControlState.Normal, UIBarMetrics.Default);
            CustomBackgroundSegmentedControl.SetBackgroundImage (UIImage.FromBundle ("stepper_and_segment_background_disabled"), UIControlState.Disabled, UIBarMetrics.Default);
            CustomBackgroundSegmentedControl.SetBackgroundImage (UIImage.FromBundle ("stepper_and_segment_background_highlighted"), UIControlState.Highlighted, UIBarMetrics.Default);
            CustomBackgroundSegmentedControl.SetDividerImage (UIImage.FromBundle ("stepper_and_segment_divider"), UIControlState.Normal, UIControlState.Normal, UIBarMetrics.Default);

            var font = UIFont.FromDescriptor (UIFontDescriptor.PreferredCaption1, 0f);

            UITextAttributes normalTextAttributes = new UITextAttributes {
                TextColor = ApplicationColors.Purple,
                Font = font
            };
            CustomBackgroundSegmentedControl.SetTitleTextAttributes (normalTextAttributes, UIControlState.Normal);

            UITextAttributes highlightedTextAttributes = new UITextAttributes {
                TextColor = ApplicationColors.Green,
                Font = font
            };
            CustomBackgroundSegmentedControl.SetTitleTextAttributes (highlightedTextAttributes, UIControlState.Highlighted);

            CustomBackgroundSegmentedControl.AccessibilityIdentifier = "CUSTOM BACKGROUND UISegmentedControl".Localize ();
            CustomBackgroundSegmentedControl.ValueChanged += SelectedSegmentDidChange;
        }
        public FavoriteClassificationsViewController(AircraftGridLayout layout) : base(layout)
        {
            classifications = new List <IClassification>();
            classifications.Add(new Amphibian());
            classifications.Add(new Commercial());
            classifications.Add(new Experimental());
            classifications.Add(new Helicopter());
            classifications.Add(new LightSport());
            classifications.Add(new Jet());
            classifications.Add(new SingleEngine());
            classifications.Add(new AircraftForSale.PCL.Single());
            classifications.Add(new TwinPiston());
            classifications.Add(new TwinTurbine());
            classifications.Add(new Vintage());
            classifications.Add(new Warbird());

            this.Title = "Registration";

            UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes
            {
                ForegroundColor = UIColor.White
            };

            UITextAttributes icoFontAttribute = new UITextAttributes();

            icoFontAttribute.Font      = UIFont.BoldSystemFontOfSize(20);
            icoFontAttribute.TextColor = UIColor.White;

            NavigationItem.BackBarButtonItem = new UIBarButtonItem("Back", UIBarButtonItemStyle.Plain, null);
            NavigationItem.BackBarButtonItem.SetTitleTextAttributes(icoFontAttribute, UIControlState.Normal);
            NavigationItem.BackBarButtonItem.TintColor = UIColor.White;
        }
Example #11
0
        private void SetNavBarItems()
        {
            var navPage = this.Element as NavigationPage;

            if (navPage == null)
            {
                return;
            }

            var textAttributes = new UITextAttributes()
            {
                Font = UIFont.FromName(customFontName, customFontSize)
            };

            var textAttributesHighlighted = new UITextAttributes()
            {
                TextColor = Color.Black.ToUIColor(),
                Font      = UIFont.FromName(customFontName, customFontSize)
            };

            var theFont               = UIFont.FromName(customFontName, customFontSize);
            var nsDictSegmentFont     = GetFontNSDictionaryReversed(theFont);
            var segmentTextAttributes = new MyUITextAttributes(nsDictSegmentFont);

            UISegmentedControl.Appearance.SetTitleTextAttributes(segmentTextAttributes, UIControlState.Normal);
            UISegmentedControl.Appearance.SetTitleTextAttributes(segmentTextAttributes, UIControlState.Selected);

            UIBarButtonItem.Appearance.SetTitleTextAttributes(textAttributes,
                                                              UIControlState.Normal);
            UIBarButtonItem.Appearance.SetTitleTextAttributes(textAttributesHighlighted,
                                                              UIControlState.Highlighted);
        }
        private void ConfigureCustomBackgroundSegmentedControl()
        {
            CustomBackgroundSegmentedControl.SelectedSegment = 2;
            CustomBackgroundSegmentedControl.SetBackgroundImage(UIImage.FromBundle("stepper_and_segment_background"), UIControlState.Normal, UIBarMetrics.Default);
            CustomBackgroundSegmentedControl.SetBackgroundImage(UIImage.FromBundle("stepper_and_segment_background_disabled"), UIControlState.Disabled, UIBarMetrics.Default);
            CustomBackgroundSegmentedControl.SetBackgroundImage(UIImage.FromBundle("stepper_and_segment_background_highlighted"), UIControlState.Highlighted, UIBarMetrics.Default);
            CustomBackgroundSegmentedControl.SetDividerImage(UIImage.FromBundle("stepper_and_segment_divider"), UIControlState.Normal, UIControlState.Normal, UIBarMetrics.Default);

            var font = UIFont.FromDescriptor(UIFontDescriptor.PreferredCaption1, 0f);

            UITextAttributes normalTextAttributes = new UITextAttributes {
                TextColor = ApplicationColors.Purple,
                Font      = font
            };

            CustomBackgroundSegmentedControl.SetTitleTextAttributes(normalTextAttributes, UIControlState.Normal);

            UITextAttributes highlightedTextAttributes = new UITextAttributes {
                TextColor = ApplicationColors.Green,
                Font      = font
            };

            CustomBackgroundSegmentedControl.SetTitleTextAttributes(highlightedTextAttributes, UIControlState.Highlighted);

            CustomBackgroundSegmentedControl.AccessibilityIdentifier = "CUSTOM BACKGROUND UISegmentedControl".Localize();
            CustomBackgroundSegmentedControl.ValueChanged           += SelectedSegmentDidChange;
        }
Example #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)
        {
            //Set the status bar
            if (Util.iOSVersion.Item1 < 6)
            {
                UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.BlackOpaque, false);
            }
            else
            {
                UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.BlackTranslucent, false);
            }

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                var textAttrs = new UITextAttributes()
                {
                    TextColor = UIColor.White, TextShadowColor = UIColor.DarkGray, TextShadowOffset = new UIOffset(0, -1)
                };
                UINavigationBar.Appearance.SetTitleTextAttributes(textAttrs);
                UISegmentedControl.Appearance.SetTitleTextAttributes(textAttrs, UIControlState.Normal);
            }

            //Set the theming
            UIBarButtonItem.Appearance.SetBackButtonBackgroundImage(Images.Controls.BackButton.CreateResizableImage(new UIEdgeInsets(0, 16, 0, 10)), UIControlState.Normal, UIBarMetrics.Default);
            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackButtonBackgroundImage(null, UIControlState.Normal, UIBarMetrics.Default);

            UIBarButtonItem.Appearance.SetBackgroundImage(Images.Controls.Button, UIControlState.Normal, UIBarMetrics.Default);
            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackgroundImage(null, UIControlState.Normal, UIBarMetrics.Default);

            UINavigationBar.Appearance.SetBackgroundImage(Images.Controls.Navbar.CreateResizableImage(new UIEdgeInsets(0, 0, 0, 0)), UIBarMetrics.Default);
            UINavigationBar.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackgroundImage(null, UIBarMetrics.Default);

            UIToolbar.Appearance.SetBackgroundImage(Images.Controls.Navbar.CreateResizableImage(new UIEdgeInsets(0, 0, 0, 0)), UIToolbarPosition.Any, UIBarMetrics.Default);

            Window                    = new UIWindow(UIScreen.MainScreen.Bounds);
            SlideController           = new SlideoutNavigationController();
            Window.RootViewController = SlideController;
            SlideController.SelectView(new RecentPatternsViewController());
            Window.MakeKeyAndVisible();


            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                UIImageView killSplash = null;
                if (IsTall)
                {
                    killSplash = new UIImageView(UIImageHelper.FromFileAuto("Default-568h"));
                }
                else
                {
                    killSplash = new UIImageView(UIImageHelper.FromFileAuto("Default"));
                }

                Window.AddSubview(killSplash);
                Window.BringSubviewToFront(killSplash);
                UIView.Animate(0.8, () => killSplash.Alpha = 0.0f, killSplash.RemoveFromSuperview);
            }

            return(true);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            //UI that must be setup from code
            View.BackgroundColor = Theme.BackgroundColor;
            title = new UILabel(new RectangleF(0, 0, 100, 36))
            {
                TextColor       = UIColor.White,
                BackgroundColor = UIColor.Clear,
                Font            = Theme.BoldFontOfSize(16),
                Text            = "Items",
            };
            titleButton   = new UIBarButtonItem(title);
            toolbar.Items = new UIBarButtonItem[] { titleButton };

            var textAttributes = new UITextAttributes {
                TextColor = UIColor.White
            };

            edit = new UIBarButtonItem("Edit", UIBarButtonItemStyle.Bordered, delegate {
                edit.Title = tableView.Editing ? "Edit" : "Done";
                tableView.SetEditing(!tableView.Editing, true);
            });
            edit.SetTitleTextAttributes(textAttributes, UIControlState.Normal);
            edit.SetBackgroundImage(Theme.BlueBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

            space = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);

            addItem = new UIBarButtonItem("Add Item", UIBarButtonItemStyle.Bordered, OnAddItem);
            addItem.SetTitleTextAttributes(textAttributes, UIControlState.Normal);
            addItem.SetBackgroundImage(Theme.BlueBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

            tableView.Source = new TableSource(this);
        }
Example #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)
        {
            // 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;
        }
Example #16
0
        private void setupNavigationBar()
        {
            //Back button title
            var attributes = new UITextAttributes
            {
                Font      = UIFont.SystemFontOfSize(14, UIFontWeight.Medium),
                TextColor = Colors.NavigationBar.BackButton.ToNativeColor()
            };

            UIBarButtonItem.Appearance.SetTitleTextAttributes(attributes, UIControlState.Normal);
            UIBarButtonItem.Appearance.SetTitleTextAttributes(attributes, UIControlState.Highlighted);
            UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(6, 0), UIBarMetrics.Default);

            //Back button icon
            var image = UIImage.FromBundle("icBackNoPadding");

            UINavigationBar.Appearance.BackIndicatorImage = image;
            UINavigationBar.Appearance.BackIndicatorTransitionMaskImage = image;

            //Title and background
            var barBackgroundColor = Colors.NavigationBar.BackgroundColor.ToNativeColor();

            UINavigationBar.Appearance.ShadowImage     = new UIImage();
            UINavigationBar.Appearance.BarTintColor    = barBackgroundColor;
            UINavigationBar.Appearance.BackgroundColor = barBackgroundColor;
            UINavigationBar.Appearance.TintColor       = Colors.NavigationBar.BackButton.ToNativeColor();
            UINavigationBar.Appearance.SetBackgroundImage(ImageExtension.ImageWithColor(barBackgroundColor), UIBarMetrics.Default);
            UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes
            {
                Font            = UIFont.SystemFontOfSize(14, UIFontWeight.Medium),
                ForegroundColor = UIColor.Black
            };
        }
Example #17
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // create a new window instance based on the screen size
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

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

            Stripe.StripeClient.DefaultPublishableKey = AppConstants.StripeAPIKey;

            MapServices.ProvideAPIKey("AIzaSyAiBwRUm_KZDv_sp3eI7F8hxkePqDTvY20");

            presenter = IsPad ? (IMvxTouchViewPresenter) new PadPresenter(this, Window) : (IMvxTouchViewPresenter) new PhonePresenter(this, Window);

            var setup = new Setup(this, presenter);

            setup.Initialize();

            //get last used language
            var language = NSUserDefaults.StandardUserDefaults.StringForKey(AppConstants.Language);

            if (string.IsNullOrEmpty(language))
            {
                Mvx.Resolve <IMvxTextProviderBuilder>().LoadResources(string.Empty);
            }
            else
            {
                Mvx.Resolve <IMvxTextProviderBuilder>().LoadResources(language);
            }

            var startup = Mvx.Resolve <IMvxAppStart>();

            startup.Start();

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

            //customize navigation bar
            UINavigationBar.Appearance.BarTintColor        = UIColor.FromRGB(35, 137, 203);
            UINavigationBar.Appearance.TintColor           = UIColor.White;
            UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes(new NSDictionary(UIStringAttributeKey.ForegroundColor, UIColor.White));
            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);


            //customize tab bar
            var textAttributes = new UITextAttributes();

            textAttributes.Font = UIFont.FromName("HelveticaNeue-Bold", 17f);
            textAttributes.Font = FontHelper.AdjustFontSize(textAttributes.Font);
            UITabBarItem.Appearance.SetTitleTextAttributes(textAttributes, UIControlState.Normal);

            //initialize Crittercism
            #if DEBUG
            #else
            Crittercism.Init("55fcbf338d4d8c0a00d07a12");
            #endif


            return(true);
        }
Example #18
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            var logOutHandler = new Action(() => ViewModel.LogoutCommand.Execute());

            if (_firstTimePresented)
            {
                _firstTimePresented = false;
                ViewModel.ShowDoneListItemViewModelCommand.Execute(logOutHandler);
                ViewModel.ShowNotDoneListItemViewModelCommand.Execute(logOutHandler);
                ViewModel.ShowAboutViewModelCommand.Execute(logOutHandler);
                UITextAttributes txtAttributes = new UITextAttributes
                {
                    Font = UIFont.FromName("HelveticaNeue-Light", 16),
                };

                for (int i = 0; i < ChildViewControllers.Length; i++)
                {
                    var size2 = ChildViewControllers[i].TabBarController.TabBar.Frame.Size.Height / 2;
                    ChildViewControllers[i].TabBarItem.SetTitleTextAttributes(txtAttributes, UIControlState.Normal);
                    ChildViewControllers[i].TabBarItem.TitlePositionAdjustment = new UIOffset(0, -6);
                }
            }
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			//UI that must be setup from code
			View.BackgroundColor = Theme.BackgroundColor;
			title = new UILabel (new RectangleF (0, 0, 100, 36)) { 
				TextColor = UIColor.White,
				BackgroundColor = UIColor.Clear,
				Font = Theme.BoldFontOfSize (16),
				Text = "Items",
			};
			titleButton = new UIBarButtonItem (title);
			toolbar.Items = new UIBarButtonItem[] { titleButton };

			var textAttributes = new UITextAttributes { TextColor = UIColor.White };
			edit = new UIBarButtonItem ("Edit", UIBarButtonItemStyle.Bordered, delegate {
				edit.Title = tableView.Editing ? "Edit" : "Done";
				tableView.SetEditing (!tableView.Editing, true);
			});
			edit.SetTitleTextAttributes (textAttributes, UIControlState.Normal);
			edit.SetBackgroundImage (Theme.BlueBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

			space = new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace);

			addItem = new UIBarButtonItem ("Add Item", UIBarButtonItemStyle.Bordered, OnAddItem);
			addItem.SetTitleTextAttributes (textAttributes, UIControlState.Normal);
			addItem.SetBackgroundImage (Theme.BlueBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

			tableView.Source = new TableSource (this);
		}
Example #20
0
        private void SetupBarItems()
        {
            var tabbedPage = (MvvmAspire.Controls.TabbedPage)Element;

            if (tabbedPage.ActiveIcons.Count > TabBar.Items.Count())
            {
                throw new ArgumentException("There are too many active icons specified.");
            }

            for (var i = 0; i < tabbedPage.ActiveIcons.Count; i++)
            {
                var tabBarItem = TabBar.Items[i];

                var normalTextAttributes = new UITextAttributes {
                    TextColor = tabbedPage.TextColor.ToUIColor()
                };
                tabBarItem.SetTitleTextAttributes(normalTextAttributes, UIControlState.Normal);

                var selectedTextAttributes = new UITextAttributes {
                    TextColor = tabbedPage.SelectedTextColor.ToUIColor()
                };
                tabBarItem.SetTitleTextAttributes(selectedTextAttributes, UIControlState.Selected);

                var iconNormalSource = tabbedPage.Children[i].Icon;
                if (!string.IsNullOrEmpty(iconNormalSource))
                {
                    var iconNormalImage = UIImage.FromFile(iconNormalSource);
                    if (iconNormalImage == null)
                    {
                        iconNormalImage = UIImage.FromBundle(iconNormalSource);
                    }

                    if (iconNormalImage == null)
                    {
                        throw new ArgumentException("Cannot find image '" + iconNormalSource + "'.");
                    }

                    iconNormalImage  = iconNormalImage.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal);
                    tabBarItem.Image = iconNormalImage;
                }

                var activeIconSource = tabbedPage.ActiveIcons[i];
                if (!string.IsNullOrEmpty(activeIconSource))
                {
                    var activeIconImage = UIImage.FromFile(activeIconSource);
                    if (activeIconImage == null)
                    {
                        activeIconImage = UIImage.FromBundle(activeIconSource);
                    }

                    if (activeIconImage == null)
                    {
                        throw new ArgumentException("Cannot find image '" + activeIconSource + "'.");
                    }

                    activeIconImage          = activeIconImage.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal);
                    tabBarItem.SelectedImage = activeIconImage;
                }
            }
        }
Example #21
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)
        {
            Forms.SetFlags("CollectionView_Experimental");
            global::Xamarin.Forms.Forms.Init();
            FFImageLoading.Forms.Platform.CachedImageRenderer.Init();

            SfRatingRenderer      sfRatingRenderer      = new SfRatingRenderer();
            SfRangeSliderRenderer sfRangeSliderRenderer = new SfRangeSliderRenderer();

            SfListViewRenderer.Init();

            WireupDependency();

            App.StatusBarHeight = UIApplication.SharedApplication.StatusBarFrame.Height;
            App.ScreenSize      = new Xamarin.Forms.Size(UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);

            var attribute = new UITextAttributes();

            attribute.TextColor = UIColor.Clear;
            UIBarButtonItem.Appearance.SetTitleTextAttributes(attribute, UIControlState.Normal);
            UIBarButtonItem.Appearance.SetTitleTextAttributes(attribute, UIControlState.Highlighted);

            var application = (Xamarin.Forms.Application)ContainerManager.Container.Resolve(typeof(App), typeof(App).ToString());

            LoadApplication(application);

            PrintFontNames();

            var result = base.FinishedLaunching(app, options);

            app.KeyWindow.TintColor = Color.FromHex("#853939").ToUIColor();
            return(result);
        }
        private void SetNavigationBar()
        {
            var leftBarButton = new UIButton();

            leftBarButton.SetImage(UIImage.FromBundle("ic_back_arrow"), UIControlState.Normal);
            leftBarButton.SetTitle(AppSettings.LocalizationManager.GetText(LocalizationKeys.PlagiarismTitle), UIControlState.Normal);
            leftBarButton.ImageEdgeInsets = new UIEdgeInsets(0, 0, 0, 20);
            leftBarButton.TitleEdgeInsets = new UIEdgeInsets(0, 20, 0, -20);
            leftBarButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            leftBarButton.TitleLabel.Font      = Constants.Semibold16;
            leftBarButton.TitleLabel.TextColor = Constants.R15G24B30;
            leftBarButton.AddTarget(GoBack, UIControlEvent.TouchDown);
            leftBarButton.SizeToFit();

            NavigationItem.LeftBarButtonItem = new UIBarButtonItem(leftBarButton);

            var guidelines     = new UIBarButtonItem(AppSettings.LocalizationManager.GetText(LocalizationKeys.GuidelinesForPlagiarism), UIBarButtonItemStyle.Plain, OpenGuidelines);
            var textAttributes = new UITextAttributes();

            textAttributes.Font      = Constants.Semibold14;
            textAttributes.TextColor = Constants.R255G34B5;
            guidelines.SetTitleTextAttributes(textAttributes, UIControlState.Normal);
            guidelines.SetTitleTextAttributes(textAttributes, UIControlState.Selected);
            NavigationItem.RightBarButtonItem = guidelines;

            NavigationController.NavigationBar.TintColor   = Constants.R15G24B30;
            NavigationController.NavigationBar.Translucent = false;
        }
Example #23
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            //this.TableView.ContentInset = new UIEdgeInsets(20, 0, 0, 0);

            this.TableView.RowHeight = 110;

            this.NavigationController.NavigationBar.BarTintColor = HelperMethods.GetLime();

            var nextBarButtonItem = new UIBarButtonItem("Next", UIBarButtonItemStyle.Plain, (sender, args) =>
            {
//StepTwoSeque
                PerformSegue("StepTwoSeque", this);
            });
            UITextAttributes icoFontAttribute = new UITextAttributes();

            icoFontAttribute.Font      = UIFont.BoldSystemFontOfSize(20);
            icoFontAttribute.TextColor = UIColor.White;

            nextBarButtonItem.SetTitleTextAttributes(icoFontAttribute, UIControlState.Normal);

            this.NavigationItem.SetRightBarButtonItem(nextBarButtonItem, true);

            var cancelBarButtonItem = new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Plain, (sender, args) =>
            {
                // button was clicked
            });

            cancelBarButtonItem.SetTitleTextAttributes(icoFontAttribute, UIControlState.Normal);

            this.NavigationItem.SetLeftBarButtonItem(cancelBarButtonItem, true);

            NavigationItem.BackBarButtonItem = new UIBarButtonItem("Back", UIBarButtonItemStyle.Plain, null);
        }
Example #24
0
        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
            homeViewController = new Tasky.Screens.controller_iPhone();

            // 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);
        }
		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;
		}
Example #26
0
        public void SetCreatePostTheme(ITextViewTheme theme)
        {
            var strAttr = new UITextAttributes();

            strAttr.TextColor = (UIColor)theme.TextColor;
            _createPostButton.SetTitleTextAttributes(strAttr, UIControlState.Normal);
        }
Example #27
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)
        {
            var tint = UIColor.FromRGB(10, 149, 145);

            tint = UIColor.FromRGB(15, 173, 194);
            //UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(250, 250, 250); //bar background
            //UINavigationBar.Appearance.TintColor = tint; //Tint color of button items

            //UIBarButtonItem.Appearance.TintColor = tint; //Tint color of button items

            UITabBar.Appearance.TintColor = tint;

            UITextAttributes txtAttributes = new UITextAttributes
            {
                Font = UIFont.FromName("Montserrat-Regular", 9.0F)
            };

            UITabBarItem.Appearance.SetTitleTextAttributes(txtAttributes, UIControlState.Normal);


            UISwitch.Appearance.OnTintColor = tint;

            UIAlertView.Appearance.TintColor = tint;

            //serve per elimare l'ombra nella barra header per creare continuità con il content sottostante
            UINavigationBar.Appearance.ShadowImage = new UIImage();
            //UINavigationBar.Appearance.SetTitleTextAttributes(txtAttributes);

            UIView.AppearanceWhenContainedIn(typeof(UIAlertController)).TintColor        = tint;
            UIView.AppearanceWhenContainedIn(typeof(UIActivityViewController)).TintColor = tint;
            UIView.AppearanceWhenContainedIn(typeof(SLComposeViewController)).TintColor  = tint;
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());
            return(base.FinishedLaunching(app, options));
        }
Example #28
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes
            {
                Font      = UIFont.FromName("Ubuntu-Bold", 18),
                TextColor = UIColor.White
            });

            var textAttributes = new UITextAttributes()
            {
                TextColor = Color.White.ToUIColor(),
                Font      = UIFont.FromName("Ubuntu-Regular", 16)
            };

            UIBarButtonItem.Appearance.SetTitleTextAttributes(textAttributes, UIControlState.Normal);
            UIBarButtonItem.Appearance.SetTitleTextAttributes(textAttributes, UIControlState.Highlighted);

            var color = (Color)Xamarin.Forms.Application.Current.Resources["TutorialNavigationBackgroundColor"];

            UINavigationBar.Appearance.SetBackgroundImage(color.ToUIColor().ToUIImage(), UIBarMetrics.Default);
            UINavigationBar.Appearance.BarTintColor    = color.ToUIColor();
            UINavigationBar.Appearance.TintColor       = UIColor.White;
            UINavigationBar.Appearance.BackgroundColor = color.ToUIColor();
            UINavigationBar.Appearance.ShadowImage     = color.ToUIColor().ToUIImage();
        }
Example #29
0
        void SetTextAttributes(UITextAttributes textAttributes, StyleProperty property)
        {
            if (property.Global)
                return;

            View.SetTitleTextAttributes(textAttributes, UIControlState.Normal);
        }
Example #30
0
        static public async Task <MenuOption> ShowContextMenu(UIView anchorView, IEnumerable <MenuOption> menuOptions)
        {
            var selectSignal = new ManualResetEventSlim();

            var options = menuOptions.ToArray();
            // create menu (segmented control)
            var segmentedControl = new UISegmentedControl(options.Select(o => o.Title).ToArray());

            var cta = segmentedControl.GetTitleTextAttributes(UIControlState.Normal);

            var ta = new UITextAttributes();

            ta.Font             = cta.Font;
            ta.TextColor        = UIColor.White;
            ta.TextShadowColor  = UIColor.White;
            ta.TextShadowOffset = cta.TextShadowOffset;

            segmentedControl.TintColor = UIColor.Clear;
            segmentedControl.SetTitleTextAttributes(ta, UIControlState.Normal);

            var controller = new UIViewController();

            controller.ModalPresentationStyle = UIModalPresentationStyle.Popover;
            controller.View = segmentedControl;
            segmentedControl.Layer.BorderWidth = 0;


            int selectedIndex = -1;

            segmentedControl.ValueChanged += (object sender, EventArgs e) => {
                selectedIndex = (int)segmentedControl.SelectedSegment;
                controller.DismissViewController(true, selectSignal.Set);
            };
            var fitSize = segmentedControl.SizeThatFits(CGSize.Empty);

            controller.PreferredContentSize = fitSize;
            var topMost = Tools.iOSTool.GetTopMostController();

            controller.PopoverPresentationController.BackgroundColor          = UIColor.Black;
            controller.PopoverPresentationController.SourceView               = anchorView;
            controller.PopoverPresentationController.SourceRect               = anchorView.Bounds;
            controller.PopoverPresentationController.PermittedArrowDirections = UIPopoverArrowDirection.Any;

            controller.PopoverPresentationController.Delegate = new ActionPopoverPresentationDelegate(
                () => {
                if (!selectSignal.IsSet)
                {
                    selectSignal.Set();
                }
            },
                (arg) => UIModalPresentationStyle.None
                );
            topMost.PresentViewController(controller, true, null);
            await Task.Run(() => selectSignal.Wait());

            var result = selectedIndex != -1 ? options[selectedIndex] : null;

            return(result);
        }
Example #31
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)
        {
            FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
            // to avoid linking issues:
            var ignore = typeof(SvgCachedImage);

            VideoPlayerKit.Init();
            PullToRefreshLayoutRenderer.Init();

            global::Xamarin.Forms.Forms.Init();

            App.ScreenWidth  = UIScreen.MainScreen.Bounds.Width;
            App.ScreenHeight = UIScreen.MainScreen.Bounds.Height;

            //UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(24, 150, 188);
            UIColor accentColor = UIColor.FromRGB(24, 150, 188);

            UINavigationBar.Appearance.TintColor = accentColor;
            UISwitch.Appearance.OnTintColor      = accentColor;

            UITextAttributes textAttributes = null;

            if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
            {
                textAttributes = new UITextAttributes()
                {
                    Font            = UIFont.FromName("SanFrancisco", (nfloat)20f),
                    TextShadowColor = UIColor.Clear,
                };
            }
            else
            {
                textAttributes = new UITextAttributes()
                {
                    Font            = UIFont.FromName("HelveticaNeue-Light", (nfloat)20f),
                    TextShadowColor = UIColor.Clear,
                };
            }

            UINavigationBar.Appearance.SetTitleTextAttributes(textAttributes);

            Distribute.DontCheckForUpdatesInDebug();

            LoadApplication(new App(new IModule[] { new PlatformContainerModule() }));

            if (options != null && options.ContainsKey(UIApplication.LaunchOptionsLocationKey))
            {
                Log.Info("LaunchOptions contains locationkey");
            }

            if (App.TabiConfig.Notifications.Enabled)
            {
                UIApplication.SharedApplication.RegisterForRemoteNotifications();
            }

            UNUserNotificationCenter.Current.RemoveDeliveredNotifications(new string[] { "termination" });

            return(base.FinishedLaunching(app, options));
        }
Example #32
0
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            //Xamarin.Calabash.Start();
#if ENABLE_TEST_CLOUD
            // requires Xamarin Test Cloud Agent
            Xamarin.Calabash.Start();
#endif

            var normalTextAttributes = new UITextAttributes();

            normalTextAttributes.Font      = UIFont.FromName("Roboto-Bold", 16.0f); // -- Unselected
            normalTextAttributes.TextColor = Color.FromHex("#174163").ToUIColor();
            UINavigationBar.Appearance.SetTitleTextAttributes(normalTextAttributes);

            UINavigationBar.Appearance.BarTintColor = Color.FromHex("#eff9ff").ToUIColor();
            UINavigationBar.Appearance.TintColor    = Color.FromHex("#174163").ToUIColor();

            UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarPosition.Any, UIBarMetrics.Default);
            UINavigationBar.Appearance.ShadowImage = new UIImage();

            global::Xamarin.Forms.Forms.Init();

            MessagingCenter.Subscribe <StartLongRunningTaskMessage>(this, "StartLongRunningTaskMessage", async message => {
                upload_task = new LongRunningTask(new UploadLongRunningTask());
                await upload_task.Start();
            });

            MessagingCenter.Subscribe <StopLongRunningTaskMessage>(this, "StopLongRunningTaskMessage", message => {
                upload_task.Stop();
            });

            //DependencyService.Register<IProgressHUD, IOSProgressHUD>();

            App.ScreenSize = new Size(UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height);

            var fr = new CultureInfo("fr-FR");
            Thread.CurrentThread.CurrentCulture = fr;
            PopolLib.iOS.Renderers.FastListView.FastListViewRenderer.Init();

            LoadApplication(new App());

            // -- Liste des Fonts dans l'application
            //var fontList = new StringBuilder();
            //var familyNames = UIFont.FamilyNames;
            //foreach (var familyName in familyNames)
            //{
            //    fontList.Append(String.Format("Family: {0}\n", familyName));
            //    Console.WriteLine("Family: {0}\n", familyName);
            //    var fontNames = UIFont.FontNamesForFamilyName(familyName);
            //    foreach (var fontName in fontNames)
            //    {
            //        Console.WriteLine("\tFont: {0}\n", fontName);
            //        fontList.Append(String.Format("\tFont: {0}\n", fontName));
            //    }
            //};

            //Console.WriteLine(fontList.ToString());
            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
        //set button properties at runtime
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();
            ViewSegmentControl.TintColor = AppColors.PEACH;
            UITextAttributes text = new UITextAttributes();

            text.TextColor = UIColor.White;
            ViewSegmentControl.SetTitleTextAttributes(text, UIControlState.Normal);
        }
        public override void ViewDidLayoutSubviews()
        {
            base.ViewDidLayoutSubviews();

            if (init)//because ViewDidLayoutSubviews called many times, so that add init flag to prevent the code below called many times
            {
                return;
            }

            CGRect tabFrame = TabBar.Frame;

            tabFrame.Height = 40;
            tabFrame.Y      = View.Frame.Y;
            TabBar.Frame    = tabFrame;
            TabBar.Items[0].TitlePositionAdjustment = new UIOffset(0, -10);
            TabBar.Items[1].TitlePositionAdjustment = new UIOffset(0, -10);

            TabBar.Items[0].Tag = 10;
            TabBar.Items[1].Tag = 11;

            UITextAttributes txtAttributes = new UITextAttributes
            {
                Font = UIFont.PreferredBody
            };

            TabBar.Items[0].SetTitleTextAttributes(txtAttributes, UIControlState.Normal);
            TabBar.Items[1].SetTitleTextAttributes(txtAttributes, UIControlState.Normal);

            var maxY = TabBar.Frame.GetMaxY();
            var maxX = TabBar.Frame.GetMaxX();

            var centerX   = maxX / 2f;
            var boxHeight = 2;
            var box       = new UIView(new CGRect(0, maxY - boxHeight, centerX, boxHeight))
            {
                //BackgroundColor = ((Color)App.Current.Resources["ThemeTextColor"]).ToUIColor()
            };

            box.GestureRecognizers = null;

            (ViewController as UITabBarController).ViewControllerSelected += (sender, e) => {
                if (e.ViewController.TabBarItem.Tag == 10)
                {
                    box.Frame = new CGRect(0, box.Frame.Y, box.Frame.Width, box.Frame.Height);//Called many times
                }
                else if (e.ViewController.TabBarItem.Tag == 11)
                {
                    box.Frame = new CGRect(centerX, box.Frame.Y, box.Frame.Width, box.Frame.Height);//Called many times
                }
            };

            if (!init)
            {
                View.AddSubview(box);
                init = true;
            }
        }
Example #35
0
        private void SetTitle()
        {
            var    att        = new UITextAttributes();
            UIFont customFont = UIFont.FromName("GothamRounded-Bold", 20);

            att.Font      = customFont;
            att.TextColor = UIColor.White;
            UINavigationBar.Appearance.SetTitleTextAttributes(att);
        }
Example #36
0
		private void ConfigureAppearanceOptions ()
		{
			var textAttributes = new UITextAttributes {
				TextColor = UIColor.White,
				TextShadowColor = UIColor.Clear,
				Font = UIFont.FromName ("SegoeUI-Light", 17f)
			};
			UIBarButtonItem.Appearance.SetTitleTextAttributes (textAttributes, UIControlState.Normal);
		}
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			// Set Text Font for unselected tab states
			UITextAttributes normalTextAttributes = new UITextAttributes();
			normalTextAttributes.Font = UIFont.FromName("ChalkboardSE-Light", 9.0F); // unselected

			UITabBarItem.Appearance.SetTitleTextAttributes(normalTextAttributes, UIControlState.Normal);
		}
        private void InitInfoButtonStyle()
        {
            var infoAttributes = new UITextAttributes ();
            infoAttributes.Font = Fonts.HelveticaNeueBold (12);
            infoAttributes.TextColor = UIColor.FromRGB (255, 255, 255);
            infoAttributes.TextShadowColor = UIColor.FromRGB (0, 0, 0);
            infoAttributes.TextShadowOffset = new UIOffset (0, 2);

            NavigationItem.RightBarButtonItem.SetTitleTextAttributes (infoAttributes, UIControlState.Normal);
        }
Example #39
0
		List<Task> tasks; // local copy of task list

		public TaskListScreen () : base (UITableViewStyle.Plain, new RootElement("Loading..."))
		{
			Title = "TaskyParse";

			UITextAttributes ta = new UITextAttributes ();
			ta.Font = UIFont.SystemFontOfSize (20f);
			UINavigationBar.Appearance.SetTitleTextAttributes (ta);
			UILabel.Appearance.Font = UIFont.SystemFontOfSize (20f);
			ta.Font = UIFont.SystemFontOfSize (12f);
			UIBarButtonItem.Appearance.SetTitleTextAttributes (ta, UIControlState.Normal);
			tasks = new List<Task>();
		}
Example #40
0
        /// <summary>
        /// Sets the theme of the application.
        /// </summary>
        private void SetTheme()
        {
            //Set the status bar
            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.BlackOpaque, false);
            UIToolbar.Appearance.SetBackgroundImage(Images.Components.Toolbar.CreateResizableImage(new UIEdgeInsets(0, 0, 0, 0)), UIToolbarPosition.Bottom, UIBarMetrics.Default);
            
            var textAttrs = new UITextAttributes { TextColor = UIColor.White, TextShadowColor = UIColor.FromRGB(40, 40, 40), TextShadowOffset = new UIOffset(0, 1) };
            UINavigationBar.Appearance.SetTitleTextAttributes(textAttrs);

            UISearchBar.Appearance.BackgroundImage = Images.Components.Searchbar.CreateResizableImage(new UIEdgeInsets(0, 1f, 0, 1f));
            UINavigationBar.Appearance.SetBackgroundImage(Images.Components.TopNavbar.CreateResizableImage(new UIEdgeInsets(0, 0, 0, 0)), UIBarMetrics.Default);
            UINavigationBar.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackgroundImage (null, UIBarMetrics.Default);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            this.NavigationBar.TintColor = UIColor.FromRGB(255,212,0);
            UITextAttributes textAttr = new UITextAttributes();
            textAttr.TextColor = UIColor.FromRGB(0,84,150);
            //textAttr.TextShadowColor = UIColor.FromRGB(0,84,150);
            this.NavigationBar.SetTitleTextAttributes(textAttr);
            this.NavigationItem.Title = "Cub Scout Motto";
            CubScoutMotto _vc = new CubScoutMotto();
            this.PushViewController(_vc, true);
        }
Example #42
0
 public RootController(IntPtr handle)
     : base(handle)
 {
     EdgesForExtendedLayout = UIRectEdge.None;
     ExtendedLayoutIncludesOpaqueBars = false;
     AutomaticallyAdjustsScrollViewInsets = false;
     //UINavigationBar.Appearance.BackgroundColor = UIColor.FromRGB(0,31,63);
     UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(0,31,63);
     UINavigationBar.Appearance.TintColor = UIColor.White;
     var attr = new UITextAttributes ();
     attr.TextColor = UIColor.White;
     UINavigationBar.Appearance.SetTitleTextAttributes(attr);
     UIApplication.SharedApplication.StatusBarHidden = false;
 }
		public override void ViewDidLoad() {
			base.ViewDidLoad ();
			UIStringAttributes myTextAttrib = new UIStringAttributes ();

			myTextAttrib.Font = UIFont.FromName ("Orbitron", 18);
			myTextAttrib.ForegroundColor = UIColor.White;

			this.NavigationItem.BackBarButtonItem = new UIBarButtonItem ("Back", 
				UIBarButtonItemStyle.Plain, null);

			this.NavigationBar.TitleTextAttributes = myTextAttrib;
			UITextAttributes myTextAttrib2 = new UITextAttributes ();
			myTextAttrib2.Font = UIFont.FromName ("Orbitron", 18);
		}
Example #44
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			Current = this;

			// 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.PhoneHomeScreen();
//			} 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);
			

			var sqliteFilename = "TaskDB.xml";
			// we need to put in /Library/ on iOS5.1 to meet Apple's iCloud terms
			// (they don't want non-user-generated data in Documents)
			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
			string libraryPath = Path.Combine (documentsPath, "../Library/"); // Library folder
            var path = Path.Combine(libraryPath, sqliteFilename);
            
			var xmlStorage = new XmlStorageImplementation ();
			TaskMgr = new TaskManager(path, xmlStorage);


			// push the view controller onto the nav controller and show the window
			navController.PushViewController(homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
Example #45
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)
        {
            //Set the status bar
            if (Util.iOSVersion.Item1 < 6)
                UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.BlackOpaque, false);
            else
                UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.BlackTranslucent, false);

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
                var textAttrs = new UITextAttributes() { TextColor = UIColor.White, TextShadowColor = UIColor.DarkGray, TextShadowOffset = new UIOffset(0, -1) };
                UINavigationBar.Appearance.SetTitleTextAttributes(textAttrs);
                UISegmentedControl.Appearance.SetTitleTextAttributes(textAttrs, UIControlState.Normal);
            }

            //Set the theming
            UIBarButtonItem.Appearance.SetBackButtonBackgroundImage(Images.Controls.BackButton.CreateResizableImage(new UIEdgeInsets(0, 16, 0, 10)), UIControlState.Normal, UIBarMetrics.Default);
            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackButtonBackgroundImage(null, UIControlState.Normal, UIBarMetrics.Default);

            UIBarButtonItem.Appearance.SetBackgroundImage(Images.Controls.Button, UIControlState.Normal, UIBarMetrics.Default);
            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackgroundImage(null, UIControlState.Normal, UIBarMetrics.Default);

            UINavigationBar.Appearance.SetBackgroundImage(Images.Controls.Navbar.CreateResizableImage(new UIEdgeInsets(0, 0, 0, 0)), UIBarMetrics.Default);
            UINavigationBar.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackgroundImage (null, UIBarMetrics.Default);

            UIToolbar.Appearance.SetBackgroundImage(Images.Controls.Navbar.CreateResizableImage(new UIEdgeInsets(0, 0, 0, 0)), UIToolbarPosition.Any, UIBarMetrics.Default);

            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            SlideController = new SlideoutNavigationController();
            Window.RootViewController = SlideController;
            SlideController.SelectView(new RecentPatternsViewController());
            Window.MakeKeyAndVisible();

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                UIImageView killSplash = null;
                if (IsTall)
                    killSplash = new UIImageView(UIImageHelper.FromFileAuto("Default-568h"));
                else
                    killSplash = new UIImageView(UIImageHelper.FromFileAuto("Default"));

                Window.AddSubview(killSplash);
                Window.BringSubviewToFront(killSplash);
                UIView.Animate(0.8, () => killSplash.Alpha = 0.0f, killSplash.RemoveFromSuperview);
            }

            return true;
        }
Example #46
0
        public static void SetFlatNavigationBarAppearance(UINavigationBar.UINavigationBarAppearance appearance, UIColor color, UIColor textColor)
        {
            UIImage backgroundImage = FlatUI.Image(color, 0);
            appearance.SetBackgroundImage(backgroundImage, UIBarMetrics.Default);
            appearance.SetBackgroundImage(backgroundImage, UIBarMetrics.LandscapePhone);

            UITextAttributes titleTextAttributes = appearance.GetTitleTextAttributes();
            if (titleTextAttributes == null)
                titleTextAttributes = new UITextAttributes();
            titleTextAttributes.TextShadowColor = UIColor.Clear;
            titleTextAttributes.TextShadowOffset = new UIOffset(0, 0);
            titleTextAttributes.TextColor = textColor;
            titleTextAttributes.Font = FlatUI.BoldFontOfSize(0);
            appearance.SetTitleTextAttributes(titleTextAttributes);
            if (appearance.RespondsToSelector(new MonoTouch.ObjCRuntime.Selector("setShadowImage:")))
                appearance.ShadowImage = FlatUI.Image(UIColor.Clear, 0);
        }
Example #47
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Current = this;
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            // Code to start the Xamarin Test Cloud Agent
            #if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
            #endif

            // 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) {
            loginscreen = new iProPQRS.LoginScreen();
            //			loginscreen = new iProPQRS.PatientListView();

            // 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);

            //To-Do
            //DB initialization

            // push the view controller onto the nav controller and show the window
            navController.PushViewController(loginscreen, false);
            window.RootViewController = navController;

            window.MakeKeyAndVisible ();
            pqrsMgr = new PQRSManager ();

            return true;
        }
            public MainScreanTabController()
            {
                var authService = new ApplicationOnlyTwitterAuthService (_consumerKey, _consumerSecret, _requestTokenUrl, _userAgent);

                var searcher = new TwitterSearcher (authService, _tweeterHostUrl, _tweeterRequestUrl);

                ViewControllers = new UIViewController[] {
                    CreateController ("#Twitter","Images/TabBar/icon_twitter.png", searcher),
                    CreateController ("#Dribbble","Images/TabBar/icon_dribbble.png", searcher),
                    CreateController ("#Apple","Images/TabBar/icon_apple.png", searcher),
                    CreateController ("#GitHub","Images/TabBar/icon_github.png", searcher)
                };

                var titleAttributes = new UITextAttributes ();
                titleAttributes.Font = Fonts.HelveticaNeueBold (13);
                titleAttributes.TextColor = UIColor.FromRGB (255, 255, 255);
                TabBarItem.SetTitleTextAttributes (titleAttributes, UIControlState.Normal);
            }
        /// <summary>
        /// Set the appearance of the navigation bar.
        /// </summary>
        private void SetNavigationBarAppearance()
        {
            // appearance
              var bar = UINavigationBar.Appearance;

              // text attributes
              var attributes = new UITextAttributes();
              attributes.TextColor = UIColor.FromWhiteAlpha(white: 0.306f, alpha: 1f);
              attributes.TextShadowOffset = new UIOffset(0, 0);
              attributes.TextShadowColor = UIColor.Clear;
              attributes.Font = UIFont.SystemFontOfSize(16);

              // navbar
              bar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
              bar.BackgroundColor = PXNConstants.COLOR_NAVIGATION;
              bar.ShadowImage = CreateNavigationBarShadowImage();
              bar.SetTitleTextAttributes(attributes);
              bar.SetTitleVerticalPositionAdjustment(3f, UIBarMetrics.Default);
        }
Example #50
0
		public override bool FinishedLaunching(UIApplication app, NSDictionary options)
		{
			Insights.Initialize(Keys.InsightsApiKey);

			//#if DEBUG
			Xamarin.Calabash.Start();
			//#endif

			Forms.Init();
			ImageCircleRenderer.Init();
			ToastNotifier.Init();
		
			//We're using the value of the StyleId as the accessibility identifier for use w/ Xamarin UITest / XTC
			Forms.ViewInitialized += (sender, e) =>
			{
				if(null != e.View.StyleId)
				{
					e.NativeView.AccessibilityIdentifier = e.View.StyleId;
				}
			};

			var atts = new UITextAttributes {
				Font = UIFont.FromName("SegoeUI", 22),
			};
			UINavigationBar.Appearance.SetTitleTextAttributes(atts);

			var barButtonAtts = new UITextAttributes {
				Font = UIFont.FromName("SegoeUI", 16),
			};

			UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
			UIBarButtonItem.Appearance.SetTitleTextAttributes(barButtonAtts, UIControlState.Normal);
			UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -100), UIBarMetrics.Default);

			LoadApplication(new App());
			ProcessPendingPayload(options);

			return base.FinishedLaunching(app, options);
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			//UI to setup from code
			title = new UILabel (new RectangleF (0, 0, 160, 36)) { 
				TextColor = UIColor.White,
				BackgroundColor = UIColor.Clear,
				Font = Theme.BoldFontOfSize (16),
				Text = "Expenses",
			};
			titleButton = new UIBarButtonItem (title);
			toolbar.Items = new UIBarButtonItem[] { titleButton };

			var textAttributes = new UITextAttributes { TextColor = UIColor.White };
			edit = new UIBarButtonItem ("Edit", UIBarButtonItemStyle.Bordered, delegate {
				edit.Title = tableView.Editing ? "Edit" : "Done";
				tableView.SetEditing (!tableView.Editing, true);
			});
			edit.SetTitleTextAttributes (textAttributes, UIControlState.Normal);
			edit.SetBackgroundImage (Theme.BlueBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

			space = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
			
			addItem = Theme.IsiOS7 ? 
			          new UIBarButtonItem(UIBarButtonSystemItem.Add, OnAddExpense) : 
			          new UIBarButtonItem ("Add Expense", UIBarButtonItemStyle.Bordered, OnAddExpense);
			addItem.SetTitleTextAttributes (textAttributes, UIControlState.Normal);
			addItem.SetBackgroundImage (Theme.BlueBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);

			tableView.Source = new TableSource (this);

			if (Theme.IsiOS7) {
				tableView.SeparatorStyle = UITableViewCellSeparatorStyle.SingleLine;
				addItem.TintColor = UIColor.White;
			} else {
				View.BackgroundColor = Theme.BackgroundColor;
			}
		}
		private void SetNavBarItems()
		{
			var navPage = this.Element as NavigationPage;

			if (navPage == null) return;

			var textAttributes = new UITextAttributes()
			{
				Font = UIFont.FromName(customFontName, customFontSize)
			};

			var textAttributesHighlighted = new UITextAttributes()
			{
				TextColor = Color.Black.ToUIColor(),
				Font = UIFont.FromName(customFontName, customFontSize)
			};

			UIBarButtonItem.Appearance.SetTitleTextAttributes(textAttributes,
				UIControlState.Normal);
			UIBarButtonItem.Appearance.SetTitleTextAttributes(textAttributesHighlighted,
				UIControlState.Highlighted);
		}
        public TabButtonView(RectangleF frame, params string[] tabs)
        {
            this.Frame = frame;

            _segment = new UISegmentedControl(tabs);
            _segment.ControlStyle = UISegmentedControlStyle.Bar;
            _segment.SelectedSegment = 0;
            _segment.AutosizesSubviews = true;
            _segment.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            _segment.Frame = this.Frame;

            //Themeing
            var textAttrs = new UITextAttributes { TextColor = UIColor.FromRGB(122, 122, 122), TextShadowColor = UIColor.White, TextShadowOffset = new UIOffset(0, 1) };
            _segment.SetTitleTextAttributes(textAttrs, UIControlState.Normal);
            //var textAttrsHighlighted = new UITextAttributes { TextColor = UIColor.White, TextShadowColor = UIColor.FromRGB(122, 122, 122), TextShadowOffset = new UIOffset(0, 1) };
            //_segment.SetTitleTextAttributes(textAttrsHighlighted, UIControlState.Highlighted);

            _segment.SetDividerImage(Images.Components.TabsVertical, UIControlState.Normal, UIControlState.Normal, UIBarMetrics.Default);
            _segment.SetBackgroundImage(Images.Components.TabsBackground, UIControlState.Normal, UIBarMetrics.Default);
            _segment.SetBackgroundImage(Images.Components.TabsHighlighted, UIControlState.Selected, UIBarMetrics.Default);

            AddSubview(_segment);

            _segment.ValueChanged += (sender, e) => {
                if (SegmentChanged != null)
                    SegmentChanged(_segment.SelectedSegment);
            };

            //            //F*****g bug in the divider
            //            BeginInvokeOnMainThread(delegate {
            //                _segment.SelectedSegment = 1;
            //                _segment.SelectedSegment = 0;
            //                _segment.SelectedSegment = MonoTouch.Utilities.Defaults.IntForKey(MultipleSelectionsKey);
            //                Title = GetTitle(_segment.SelectedSegment);
            //
            //            });
        }
Example #54
0
		private void InitUI ()
		{
			NavigationController.SetNavigationBarHidden (false, true);

			NavigationController.NavigationBar.SetBackgroundImage(NavigationController.NavigationBar.BarTintColor.ToImage(new CGRect(0,0,NavigationController.View.Frame.Width, NavigationController.NavigationBar.Frame.Height + 20)), UIBarPosition.Any, UIBarMetrics.Default);
			NavigationController.NavigationBar.ShadowImage = NavigationController.NavigationBar.BarTintColor.ToImage(new CGRect(0,0, NavigationController.View.Frame.Width, 1));

			var attributes = new UITextAttributes () {
				Font = UIFont.FromName ("SanFranciscoText-Light", 13)
			};
			SortOrderSegmentedControl.SetTitleTextAttributes(attributes, UIControlState.Normal);

			NameLabel.Text = ViewModel.Title;
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			_picker = (GMImagePickerController) NavigationController.ParentViewController;
			View.BackgroundColor = _picker.PickerBackgroundColor;

			// Navigation bar customization
			if (!string.IsNullOrWhiteSpace (_picker.CustomNavigationBarPrompt)) {
				NavigationItem.Prompt = _picker.CustomNavigationBarPrompt;
			}

			_imageManager = new PHCachingImageManager ();

			// Table view aspect
			TableView.RowHeight = AlbumRowHeight;
			TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
			TableView.Source = new GMAlbumsViewTableViewSource (this);

			// Buttons
			var barButtonItemAttributes = new UITextAttributes {
				Font = UIFont.FromName(_picker.PickerFontName, _picker.PickerFontHeaderSize)
			};
					
			var cancelTitle = _picker.CustomCancelButtonTitle ?? "picker.navigation.cancel-button".Translate(defaultValue: "Cancel");
			NavigationItem.LeftBarButtonItem = new UIBarButtonItem (cancelTitle,
				UIBarButtonItemStyle.Plain,
				Dismiss);

			if (_picker.UseCustomFontForNavigationBar) {
				NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(barButtonItemAttributes, UIControlState.Normal);
				NavigationItem.LeftBarButtonItem.SetTitleTextAttributes(barButtonItemAttributes, UIControlState.Highlighted);
			}

			if (_picker.AllowsMultipleSelection) {
				var doneTitle = _picker.CustomDoneButtonTitle ?? "picker.navigation.done-button".Translate(defaultValue: "Done");
				NavigationItem.RightBarButtonItem = new UIBarButtonItem (doneTitle,
					UIBarButtonItemStyle.Done,
					FinishPickingAssets);
				if (_picker.UseCustomFontForNavigationBar) {
					NavigationItem.RightBarButtonItem.SetTitleTextAttributes(barButtonItemAttributes, UIControlState.Normal);
					NavigationItem.RightBarButtonItem.SetTitleTextAttributes(barButtonItemAttributes, UIControlState.Highlighted);
				}
				NavigationItem.RightBarButtonItem.Enabled = _picker.AutoDisableDoneButton ? _picker.SelectedAssets.Any () : true;
			}

			// Bottom toolbar
			ToolbarItems = _picker.GetToolbarItems();

			// Title
			Title = _picker.Title ?? "picker.navigation.title".Translate(defaultValue: "Navigation bar default title");

			// Fetch PHAssetCollections
			var topLevelUserCollections = PHCollectionList.FetchTopLevelUserCollections(null);
			var smartAlbums = PHAssetCollection.FetchAssetCollections (PHAssetCollectionType.SmartAlbum, PHAssetCollectionSubtype.AlbumRegular, null);
			_collectionsFetchResults = new List<PHFetchResult> { topLevelUserCollections, smartAlbums };
			_collectionsLocalizedTitles = new List<string> { "picker.table.user-albums-header".Translate (defaultValue: "Albums"), "picker.table.smart-albums-header".Translate("Smart Albums") };

			UpdateFetchResults ();

			// Register for changes
			PHPhotoLibrary.SharedPhotoLibrary.RegisterChangeObserver(this);

			if (UIDevice.CurrentDevice.CheckSystemVersion (7, 0)) {
				EdgesForExtendedLayout = UIRectEdge.None;
			}
		}
Example #56
0
        private void CustomizeAppearance()
        {
            UIImage gradientImage44 = UIImage.FromBundle(@"images/appview/top-bar");
            UIEdgeInsets capInsets = new UIEdgeInsets(0,0,0,0);
            gradientImage44.CreateResizableImage(capInsets);
            UINavigationBar.Appearance.SetBackgroundImage(gradientImage44, UIBarMetrics.Default);

            UITextAttributes titleAttributes = new UITextAttributes() {
                TextColor = UIColor.FromRGBA(red:0.204f, green:0.212f, blue:0.239f, alpha:1f),
                TextShadowColor = UIColor.FromRGBA(red:1f, green:1f, blue:1f, alpha:0.8f),
                TextShadowOffset = new UIOffset(horizontal:0, vertical:1),
                Font = UIFont.FromName("Helvetica-Neue", size:0.0f),
            };

            UINavigationBar.Appearance.SetTitleTextAttributes(titleAttributes);
        }
		void UpdateBarTextColor()
		{
			if (Tabbed == null || TabBar == null || TabBar.Items == null)
				return;

			var barTextColor = Tabbed.BarTextColor;
			var isDefaultColor = barTextColor.IsDefault;

			if (isDefaultColor && !_barTextColorWasSet)
				return;

			if (!_defaultBarTextColorSet)
			{
				_defaultBarTextColor = TabBar.TintColor; 
				_defaultBarTextColorSet = true;
			}

			if (!isDefaultColor)
				_barTextColorWasSet = true;

			var attributes = new UITextAttributes();

			if (isDefaultColor)
				attributes.TextColor = _defaultBarTextColor;
			else
				attributes.TextColor = barTextColor.ToUIColor();

			foreach (UITabBarItem item in TabBar.Items)
			{
				item.SetTitleTextAttributes(attributes, UIControlState.Normal);
			}

			// set TintColor for selected icon
			// setting the unselected icon tint is not supported by iOS
			if (Forms.IsiOS7OrNewer)
			{
				TabBar.TintColor = isDefaultColor ? _defaultBarTextColor : barTextColor.ToUIColor();
			}
		}
Example #58
0
		private void AdjustDefaultUI ()
		{
			
			//UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(red: 34, green: 91, blue: 149);
			UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB (red: 128, green: 153, blue: 77);
			UIBarButtonItem.Appearance.TintColor = UIColor.White;

			UINavigationBar.Appearance.TintColor = UIColor.White;
			var navStyle = new UITextAttributes () {
				TextColor = UIColor.White,
				TextShadowColor = UIColor.Clear,

				Font = UIFont.FromName ("OpenSans-Light", 16f)
			};

			UINavigationBar.Appearance.SetTitleTextAttributes (navStyle); 
			UIImageView.AppearanceWhenContainedIn (typeof(UINavigationBar)).TintColor = UIColor.White;
			UIBarButtonItem.Appearance.SetTitleTextAttributes (navStyle, UIControlState.Normal);
		}
Example #59
0
		void UpdateBarTextColor()
		{
			if (Tabbed == null || TabBar == null || TabBar.Items == null)
				return;

			var barTextColor = Tabbed.BarTextColor;

			var globalAttributes = UINavigationBar.Appearance.GetTitleTextAttributes();

			var attributes = new UITextAttributes { Font = globalAttributes.Font };

			if (barTextColor == Color.Default)
				attributes.TextColor = globalAttributes.TextColor;
			else
				attributes.TextColor = barTextColor.ToUIColor();

			foreach (UITabBarItem item in TabBar.Items)
			{
				item.SetTitleTextAttributes(attributes, UIControlState.Normal);
			}

			// set TintColor for selected icon
			// setting the unselected icon tint is not supported by iOS
			if (Forms.IsiOS7OrNewer)
			{
				TabBar.TintColor = barTextColor == Color.Default ? UINavigationBar.Appearance.TintColor : barTextColor.ToUIColor();
			}
		}
 private void InitTabBarItemsStyle()
 {
     var titleAttributes = new UITextAttributes ();
     titleAttributes.Font = Fonts.HelveticaNeueBold (10);
     titleAttributes.TextColor = UIColor.FromRGB (255, 255, 255);
     TabBarItem.SetTitleTextAttributes (titleAttributes, UIControlState.Normal);
 }