Ejemplo n.º 1
0
        protected void AttachSearchBar()
        {
            if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
            {
                var field = SearchController.SearchBar.SearchTextField;
                field.BackgroundColor = UIColor.Clear;
                field.TextColor       = UIColor.Black;
                field.TintColor       = UIColor.White;

                var segment = UISegmentedControl.AppearanceWhenContainedIn(new[] { typeof(UISearchBar) });
                segment.BackgroundColor = UIColor.White;
                segment.SetTitleTextAttributes(new UITextAttributes
                {
                    TextColor = UIColor.DarkGray
                }, UIControlState.Normal);
                segment.SetTitleTextAttributes(new UITextAttributes
                {
                    TextColor = NavigationController.NavigationBar.BarTintColor
                }, UIControlState.Selected);

                var iconView = field.LeftView as UIImageView;
                iconView.Image     = iconView.Image.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                iconView.TintColor = UIColor.Gray;
                NavigationItem.HidesSearchBarWhenScrolling = false;
                NavigationItem.SearchController            = SearchController;
            }
        }
Ejemplo n.º 2
0
        public static void Setup()
        {
            var theme = new Theme();

            CurrentTheme = theme;
            CodeFramework.iOS.Theme.CurrentTheme = theme;

            var defaultValues = Cirrious.CrossCore.Mvx.Resolve <CodeFramework.Core.Services.IDefaultValueService>();

            bool largeFonts;

            if (!defaultValues.TryGet <bool>("large_fonts", out largeFonts))
            {
                largeFonts = false;
            }
            Theme.CurrentTheme.FontSizeRatio = largeFonts ? 1.3f : 1.0f;

            RepositoryCellView.RoundImages = false;
            MonoTouch.Dialog.NameTimeStringElement.NameColor = Theme.CurrentTheme.MainTitleColor;
            MonoTouch.Dialog.Element.FontSizeRatio           = Theme.CurrentTheme.FontSizeRatio;

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
            UINavigationBar.Appearance.TintColor           = UIColor.White;
            UINavigationBar.Appearance.BarTintColor        = UIColor.FromRGB(50, 50, 50);
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White, Font = UIFont.SystemFontOfSize(18f)
            });
            CodeFramework.iOS.Utils.Hud.BackgroundTint    = UIColor.FromRGBA(228, 228, 228, 128);
            UINavigationBar.Appearance.BackIndicatorImage = Theme.CurrentTheme.BackButton;
            UINavigationBar.Appearance.BackIndicatorTransitionMaskImage = Theme.CurrentTheme.BackButton;

            UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -64), UIBarMetrics.LandscapePhone);
            UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -64), UIBarMetrics.Default);

            UserVoice.UVStyleSheet.Instance.NavigationBarTintColor = UIColor.White;
            UserVoice.UVStyleSheet.Instance.NavigationBarTextColor = UIColor.White;

            UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(110, 110, 117);
            UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationBar)).TintColor = UIColor.White;

            // Composer Input Accessory Buttons
            UIButton.AppearanceWhenContainedIn(typeof(UIScrollView)).TintColor = UIColor.FromRGB(50, 50, 50);

            UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = UIColor.FromRGB(136, 136, 136);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).Font      = UIFont.SystemFontOfSize(13f * Theme.CurrentTheme.FontSizeRatio);

            UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White
            }, UIControlState.Normal);

//            CodeFramework.Elements.NewsFeedElement.LinkColor = theme.MainTitleColor;
//            CodeFramework.Elements.NewsFeedElement.TextColor = theme.MainTextColor;
//            CodeFramework.Elements.NewsFeedElement.NameColor = theme.MainTitleColor;
        }
Ejemplo n.º 3
0
        public static void Setup()
        {
            var theme = new Theme();

            CurrentTheme = theme;

            var primaryColor  = Theme.CurrentTheme.PrimaryColor;
            var iconColor     = UIColor.FromRGB(0x5B, 0x61, 0x65);
            var backgroundImg = CreateBackgroundImage(primaryColor);

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
            UINavigationBar.Appearance.TintColor           = UIColor.White;
            UINavigationBar.Appearance.SetBackgroundImage(backgroundImg, UIBarMetrics.Default);
            UINavigationBar.Appearance.BarTintColor = primaryColor;
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White, Font = UIFont.SystemFontOfSize(18f)
            });
            CodeHub.iOS.Utilities.Hud.BackgroundTint = UIColor.FromRGBA(228, 228, 228, 128);
            CodeHub.iOS.Services.AlertDialogService.BackgroundTint = UIColor.FromRGBA(228, 228, 228, 128);

            UINavigationBar.Appearance.BackIndicatorImage = Images.Buttons.BackButton;
            UINavigationBar.Appearance.BackIndicatorTransitionMaskImage = Images.Buttons.BackButton;

            var version = new Version(UIDevice.CurrentDevice.SystemVersion);

            if (version.Major < 11)
            {
                UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -System.nfloat.MaxValue), UIBarMetrics.LandscapePhone);
                UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -System.nfloat.MaxValue), UIBarMetrics.Default);
            }

            UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(110, 110, 117);
            UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationBar)).TintColor = UIColor.White;

            // Composer Input Accessory Buttons
            UIButton.AppearanceWhenContainedIn(typeof(UIScrollView)).TintColor = UIColor.FromRGB(50, 50, 50);

            UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = UIColor.FromRGB(136, 136, 136);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).Font      = UIFont.SystemFontOfSize(13f);

            UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White
            }, UIControlState.Normal);

            UIImageView.AppearanceWhenContainedIn(typeof(UITableViewCell), typeof(MonoTouch.SlideoutNavigation.MainNavigationController)).TintColor = iconColor;

            EmptyListView.DefaultColor        = primaryColor;
            LoadingIndicatorView.DefaultColor = primaryColor;
        }
Ejemplo n.º 4
0
        public static void Setup()
        {
            UIGraphics.BeginImageContext(new CoreGraphics.CGSize(1, 64f));
            Theme.PrimaryNavigationBarColor.SetFill();
            UIGraphics.RectFill(new CoreGraphics.CGRect(0, 0, 1, 64));
            var img = UIGraphics.GetImageFromCurrentImageContext();

            UIGraphics.EndImageContext();

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;

            var navBarContainers = new [] { typeof(MenuNavigationController), typeof(ThemedNavigationController), typeof(MainNavigationController) };

            foreach (var navbarAppearance in navBarContainers.Select(x => UINavigationBar.AppearanceWhenContainedIn(x)))
            {
                navbarAppearance.TintColor       = Theme.PrimaryNavigationBarTextColor;
                navbarAppearance.BarTintColor    = Theme.PrimaryNavigationBarColor;
                navbarAppearance.BackgroundColor = Theme.PrimaryNavigationBarColor;
                navbarAppearance.SetTitleTextAttributes(new UITextAttributes {
                    TextColor = Theme.PrimaryNavigationBarTextColor, Font = UIFont.SystemFontOfSize(18f)
                });
                navbarAppearance.SetBackgroundImage(img, UIBarPosition.Any, UIBarMetrics.Default);
                navbarAppearance.BackIndicatorImage = Images.BackButton;
                navbarAppearance.BackIndicatorTransitionMaskImage = Images.BackButton;
            }

            UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(110, 110, 117);
            UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationBar)).TintColor = UIColor.White;

            UISwitch.Appearance.OnTintColor = UIColor.FromRGB(0x41, 0x83, 0xc4);

            // Composer Input Accessory Buttons
            UIButton.AppearanceWhenContainedIn(typeof(UIScrollView)).TintColor = Theme.PrimaryNavigationBarColor;

            //UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            var headerFooterContainers = new [] { typeof(UITableViewHeaderFooterView) };

            foreach (var navbarAppearance in headerFooterContainers)
            {
                UILabel.AppearanceWhenContainedIn(navbarAppearance).TextColor = UIColor.FromRGB(110, 110, 117);
                UILabel.AppearanceWhenContainedIn(navbarAppearance).Font      = UIFont.SystemFontOfSize(14f);
            }

            StringElement.DefaultTintColor = Theme.PrimaryNavigationBarColor;

            UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White
            }, UIControlState.Normal);
        }
Ejemplo n.º 5
0
        public static void Setup()
        {
            var theme = new Theme();

            CurrentTheme       = theme;
            Theme.CurrentTheme = theme;

            var backgroundImg = CreateBackgroundImage(Theme.CurrentTheme.PrimaryColor);
            var barTypes      = new [] { typeof(MainNavigationController), typeof(ThemedNavigationController) };

            foreach (var bar in barTypes.Select(x => UINavigationBar.AppearanceWhenContainedIn(x)))
            {
                SetApperance(bar, backgroundImg, Theme.CurrentTheme.PrimaryColor);
            }

            var menuColor = UIColor.FromRGB(50, 50, 50);
            var menuImg   = CreateBackgroundImage(menuColor);
            var menuApp   = UINavigationBar.AppearanceWhenContainedIn(typeof(MenuNavigationController));

            SetApperance(menuApp, menuImg, menuColor);

            foreach (var buttonItem in barTypes.Select(x => UIBarButtonItem.AppearanceWhenContainedIn(x)))
            {
                buttonItem.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -64), UIBarMetrics.LandscapePhone);
                buttonItem.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -64), UIBarMetrics.Default);
            }

            UISegmentedControl.AppearanceWhenContainedIn(typeof(UIToolbar)).TintColor = Theme.CurrentTheme.PrimaryColor;

            UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = UIColor.FromRGB(136, 136, 136);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).Font      = UIFont.SystemFontOfSize(13f);

            UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White
            }, UIControlState.Normal);

            UIImageView.AppearanceWhenContainedIn(typeof(UITableViewCell), typeof(MainNavigationController)).TintColor = Theme.CurrentTheme.IconColor;

            EmptyListView.DefaultColor = Theme.CurrentTheme.PrimaryColor;
        }
Ejemplo n.º 6
0
        public static void Setup()
        {
            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;

            var menuNavBarBackground = CreateBackgroundImage(Theme.PrimaryMenuNavigationBarColor);
            var menuNavBarContainer  = UINavigationBar.AppearanceWhenContainedIn(typeof(MenuNavigationController));

            menuNavBarContainer.TintColor       = Theme.PrimaryMenuNavigationBarTextColor;
            menuNavBarContainer.BarTintColor    = Theme.PrimaryMenuNavigationBarColor;
            menuNavBarContainer.BackgroundColor = Theme.PrimaryMenuNavigationBarColor;
            menuNavBarContainer.SetTitleTextAttributes(new UITextAttributes {
                TextColor = Theme.PrimaryMenuNavigationBarTextColor, Font = UIFont.SystemFontOfSize(18f)
            });
            menuNavBarContainer.SetBackgroundImage(menuNavBarBackground, UIBarPosition.Any, UIBarMetrics.Default);
            menuNavBarContainer.BackIndicatorImage = Images.BackButton;
            menuNavBarContainer.BackIndicatorTransitionMaskImage = Images.BackButton;

            UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(110, 110, 117);
            UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationBar)).TintColor = UIColor.White;

            // Composer Input Accessory Buttons
            UIButton.AppearanceWhenContainedIn(typeof(UIScrollView)).TintColor = Theme.PrimaryNavigationBarColor;

            //UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            var headerFooterContainers = new [] { typeof(UITableViewHeaderFooterView) };

            foreach (var navbarAppearance in headerFooterContainers)
            {
                UILabel.AppearanceWhenContainedIn(navbarAppearance).TextColor = UIColor.FromRGB(110, 110, 117);
                UILabel.AppearanceWhenContainedIn(navbarAppearance).Font      = UIFont.SystemFontOfSize(14f);
            }

            MenuSectionView.DefaultBackgroundColor = Theme.PrimaryMenuNavigationBarColor;
            MenuSectionView.DefaultTextColor       = Theme.MenuSectionTextColor;

            UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White
            }, UIControlState.Normal);
        }
Ejemplo n.º 7
0
        private void Theme()
        {
            //UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;

            UISwitch.Appearance.OnTintColor = UIColor.FromRGB(45, 80, 148);

            UINavigationBar.Appearance.TintColor    = UIColor.White;
            UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(45, 80, 148);
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White, Font = UIFont.SystemFontOfSize(18f)
            });
            UINavigationBar.Appearance.BackIndicatorImage = CodeFramework.iOS.Images.BackButton;
            UINavigationBar.Appearance.BackIndicatorTransitionMaskImage = CodeFramework.iOS.Images.BackButton;

            UIImageView.AppearanceWhenContainedIn(typeof(UITableViewCell)).TintColor = UIColor.FromRGB(45, 80, 148);

            MonoTouch.Dialog.SplitButtonElement.TextColor = UIColor.FromRGB(45, 80, 148);

            //CodeFramework.iOS.Utils.Hud.BackgroundTint = UIColor.FromRGBA(228, 228, 228, 128);

            //UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(45,80,148);

            UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationController)).TintColor = UIColor.White;

            UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = UIColor.FromRGB(136, 136, 136);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).Font      = UIFont.SystemFontOfSize(13f);

            //UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes()
            {
                TextColor = UIColor.White,
            }, UIControlState.Normal);

//            CodeFramework.iOS.Views.StartupView.TextColor = UIColor.FromWhiteAlpha(0.9f, 1.0f);
//            CodeFramework.iOS.Views.StartupView.SpinnerColor = UIColor.FromWhiteAlpha(0.85f, 1.0f);
//            CodeFramework.iOS.Views.StartupView.StatusBarStyle = UIStatusBarStyle.LightContent;
        }
Ejemplo n.º 8
0
        public static void Setup()
        {
            var theme = new Theme();

            CurrentTheme = theme;

            var defaultValues = IoC.Resolve <IDefaultValueService>();

            bool largeFonts;

            if (!defaultValues.TryGet("large_fonts", out largeFonts))
            {
                largeFonts = false;
            }
            Theme.CurrentTheme.FontSizeRatio = largeFonts ? 1.3f : 1.0f;

            UIGraphics.BeginImageContext(new System.Drawing.SizeF(1, 64f));
            UIColor.FromRGB(50, 50, 50).SetFill();
            UIGraphics.RectFill(new System.Drawing.RectangleF(0, 0, 1, 64));
            var img = UIGraphics.GetImageFromCurrentImageContext();

            UIGraphics.EndImageContext();

            NameTimeStringElement.NameColor = Theme.CurrentTheme.MainTitleColor;
            //Element.FontSizeRatio = Theme.CurrentTheme.FontSizeRatio;

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;

            var navBarContainers = new [] { typeof(MenuNavigationController), typeof(ThemedNavigationController), typeof(MainNavigationController) };

            foreach (var navbarAppearance in navBarContainers.Select(x => UINavigationBar.AppearanceWhenContainedIn(x)))
            {
                navbarAppearance.TintColor       = UIColor.White;
                navbarAppearance.BarTintColor    = UIColor.FromRGB(50, 50, 50);
                navbarAppearance.BackgroundColor = UIColor.FromRGB(50, 50, 50);
                navbarAppearance.SetTitleTextAttributes(new UITextAttributes {
                    TextColor = UIColor.White, Font = UIFont.SystemFontOfSize(18f)
                });
                navbarAppearance.SetBackgroundImage(img, UIBarPosition.Any, UIBarMetrics.Default);
                //CodeFramework.iOS.Utils.Hud.BackgroundTint = UIColor.FromRGBA(228, 228, 228, 128);
                navbarAppearance.BackIndicatorImage = Images.BackButton;
                navbarAppearance.BackIndicatorTransitionMaskImage = Images.BackButton;
            }


//            UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(-1000, -64), UIBarMetrics.LandscapePhone);
//            UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(-1000, -64), UIBarMetrics.Default);
//
//            UserVoice.UVStyleSheet.Instance.NavigationBarTintColor = UIColor.White;
//            UserVoice.UVStyleSheet.Instance.NavigationBarTextColor = UIColor.White;

            UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(110, 110, 117);
            UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationBar)).TintColor = UIColor.White;

            // Composer Input Accessory Buttons
            UIButton.AppearanceWhenContainedIn(typeof(UIScrollView)).TintColor = UIColor.FromRGB(50, 50, 50);

            UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = UIColor.FromRGB(136, 136, 136);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).Font      = UIFont.SystemFontOfSize(13f * Theme.CurrentTheme.FontSizeRatio);

            UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White
            }, UIControlState.Normal);

//            CodeFramework.Elements.NewsFeedElement.LinkColor = theme.MainTitleColor;
//            CodeFramework.Elements.NewsFeedElement.TextColor = theme.MainTextColor;
//            CodeFramework.Elements.NewsFeedElement.NameColor = theme.MainTitleColor;
        }