Example #1
0
        public void ShowMainPage()
        {
            tabbedPage = new IconTabbedPage
            {
                Title              = "Supermercado Rodriguez",
                BarTextColor       = Color.White,
                BarBackgroundColor = Color.Red
            };


            tabbedPage.Children.Add(new BonosView
            {
                Title = "Bonos",
                Icon  = "fa-money"
            });

            tabbedPage.Children.Add(new ComprasView
            {
                Title = "Compras",
                Icon  = "fa-shopping-cart"
            });

            tabbedPage.Children.Add(new ConfigView
            {
                Title = "Configuración",
                Icon  = "fa-cogs"
            });

            MainPage = new IconNavigationPage(tabbedPage)
            {
                BarTextColor       = Color.White,
                BarBackgroundColor = Color.Red
            };
        }
Example #2
0
        public Application()
        {
            InitializeComponent();
            Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeRegularModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeBrandsModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeSolidModule())
            .With(new Plugin.Iconize.Fonts.EntypoPlusModule())
            .With(new Plugin.Iconize.Fonts.IoniconsModule())
            .With(new Plugin.Iconize.Fonts.MaterialModule())
            .With(new Plugin.Iconize.Fonts.MeteoconsModule())
            .With(new Plugin.Iconize.Fonts.SimpleLineIconsModule())
            .With(new Plugin.Iconize.Fonts.TypiconsModule())
            .With(new Plugin.Iconize.Fonts.WeatherIconsModule());
            // The root page of your application
            var tabbedPage = new IconTabbedPage {
                Title = "Iconize"
            };

            foreach (var module in Plugin.Iconize.Iconize.Modules)
            {
                var bc   = new ModuleWrapper(module);
                var icon = module.Keys.FirstOrDefault();
                tabbedPage.Children.Add(new Page1
                {
                    BindingContext = bc,
                    Icon           = icon
                });
            }

            MainPage = new IconNavigationPage(tabbedPage);
        }
Example #3
0
        public App()
        {
            // The root page of your application

            //IconizeライブラリのIconTabbedPageを使用する為、TabbedPageの生成のみXAMLではなくC#で記載。
            //※試したらXAMLでも書けました。
            var TabbedPage = new IconTabbedPage {
                Title = "Twitter"
            };

            foreach (var module in Plugin.Iconize.Iconize.Modules)
            {
                TabbedPage.Children.Add(new MainPage
                {
                    BindingContext = new MainPageViewModel(),
                    Icon           = "fa-home"
                });

                TabbedPage.Children.Add(new TweetPage
                {
                    BindingContext = new TweetPageViewModel(),
                    Icon           = "fa-twitter"
                });
            }

            MainPage = new IconNavigationPage(TabbedPage);
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="App"/> class.
        /// </summary>
        public App()
        {
            InitializeComponent();

            Plugin.Iconize.Iconize
            //.With(new Plugin.Iconize.Fonts.EntypoPlusModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeRegularModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeBrandsModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeSolidModule())
            //.With(new Plugin.Iconize.Fonts.IoniconsModule())
            //.With(new Plugin.Iconize.Fonts.JamIconsModule())
            //.With(new Plugin.Iconize.Fonts.MaterialModule())
            //.With(new Plugin.Iconize.Fonts.MeteoconsModule())
            //.With(new Plugin.Iconize.Fonts.SimpleLineIconsModule())
            //.With(new Plugin.Iconize.Fonts.TypiconsModule())
            //.With(new Plugin.Iconize.Fonts.WeatherIconsModule())
            ;
            // The root page of your application
            var tabbedPage = new IconTabbedPage {
                Title = "Iconize"
            };

            tabbedPage.On <Xamarin.Forms.PlatformConfiguration.Android>().SetBarItemColor(Xamarin.Forms.Color.Yellow);
            tabbedPage.On <Xamarin.Forms.PlatformConfiguration.Android>().SetBarSelectedItemColor(Xamarin.Forms.Color.Black);
            tabbedPage.On <Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);


            for (int i = 0; i < Math.Min(Plugin.Iconize.Iconize.Modules.Count, 5); i++)
            {
                var module = Plugin.Iconize.Iconize.Modules[i];
                Console.WriteLine("module " + module.FontName);
                var bc   = new ModuleWrapper(module);
                var icon = module.Keys.FirstOrDefault();
                tabbedPage.Children.Add(new Page1
                {
                    BindingContext = bc,
                    Icon           = icon
                });
            }


            //foreach (var module in Plugin.Iconize.Iconize.Modules)
            //{
            //    var bc = new ModuleWrapper(module);
            //    var icon = module.Keys.FirstOrDefault();
            //    tabbedPage.Children.Add(new Page1
            //    {
            //        BindingContext = bc,
            //        Icon = icon
            //    });
            //}

            MainPage = new IconNavigationPage(tabbedPage);
        }
Example #5
0
        public App()
        {
            Current = this;

            InitializeComponent();

            var isLoggedIn = Properties.ContainsKey("IsLoggedIn") && (bool)Properties["IsLoggedIn"];
            var cliente    = Properties.ContainsKey("cliente") ? Properties["cliente"] : null;

            // we remember if they're logged in, and only display the login page if they're not
            if (isLoggedIn && cliente != null)
            {
                tabbedPage = new IconTabbedPage
                {
                    Title              = "Supermercado Rodriguez",
                    BarTextColor       = Color.White,
                    BarBackgroundColor = Color.Red
                };


                tabbedPage.Children.Add(new BonosView
                {
                    Title = "Bonos",
                    Icon  = "fa-money"
                });

                tabbedPage.Children.Add(new ComprasView
                {
                    Title = "Compras",
                    Icon  = "fa-shopping-cart"
                });

                tabbedPage.Children.Add(new ConfigView
                {
                    Title = "Configuración",
                    Icon  = "fa-cogs"
                });

                MainPage = new IconNavigationPage(tabbedPage)
                {
                    BarTextColor       = Color.White,
                    BarBackgroundColor = Color.Red
                };
            }
            else
            {
                MainPage = new Login();
            }
        }
Example #6
0
        public App()
        {
            // The root page of your application
            var tabbedPage = new IconTabbedPage {
                Title = "Iconize"
            };

            foreach (var module in Plugin.Iconize.Iconize.Modules)
            {
                tabbedPage.Children.Add(new Page1
                {
                    BindingContext = new ModuleWrapper(module),
                    Icon           = module.Keys.FirstOrDefault()
                });
            }

            MainPage = new IconNavigationPage(tabbedPage);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <TabbedPage> e)
        {
            Control = (IconTabbedPage)Element;

            if (Control == null)
            {
                return;
            }

            COLOR = "#" + AndroidColorHelper.ToHex(Control.BarBackgroundColor);
            //Récupération de la couleur défini sur le control
            selectionColor = Control.BarTextColor != null?Control.BarTextColor.ToAndroid() : Xamarin.Forms.Color.Default.ToAndroid();

            unselectionColor = Control.UnselectedTextColor != null?Control.UnselectedTextColor.ToAndroid() : Xamarin.Forms.Color.Default.ToAndroid();

            base.OnElementChanged(e);

            activity    = this.Context as Activity;
            _tabbedPage = e.NewElement as TabbedPage;

            //HackPolicy();
        }
Example #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="App"/> class.
        /// </summary>
        public App()
        {
            InitializeComponent();

            Plugin.Iconize.Iconize
            .With(new Plugin.Iconize.Fonts.EntypoPlusModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeRegularModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeBrandsModule())
            .With(new Plugin.Iconize.Fonts.FontAwesomeSolidModule())
            .With(new Plugin.Iconize.Fonts.IoniconsModule())
            .With(new Plugin.Iconize.Fonts.MaterialModule())
            .With(new Plugin.Iconize.Fonts.MeteoconsModule())
            .With(new Plugin.Iconize.Fonts.SimpleLineIconsModule())
            .With(new Plugin.Iconize.Fonts.TypiconsModule())
            .With(new Plugin.Iconize.Fonts.WeatherIconsModule());

            // The root page of your application
            var tabbedPage = new IconTabbedPage {
                Title = "Iconize"
            };

            tabbedPage.On <Xamarin.Forms.PlatformConfiguration.Android>().SetBarItemColor(Xamarin.Forms.Color.Green);
            tabbedPage.On <Xamarin.Forms.PlatformConfiguration.Android>().SetBarSelectedItemColor(Xamarin.Forms.Color.Black);

            foreach (var module in Plugin.Iconize.Iconize.Modules)
            {
                var bc   = new ModuleWrapper(module);
                var icon = module.Keys.FirstOrDefault();
                tabbedPage.Children.Add(new Page1
                {
                    BindingContext = bc,
                    Icon           = icon
                });
            }

            MainPage = new IconNavigationPage(tabbedPage);
        }
Example #9
0
        public override void ViewDidAppear(bool animated)
        {
            IconTabbedPage Control = (IconTabbedPage)Element;

            if (Control == null)
            {
                return;
            }

            //Resolving color
            UIColor selectionColor = Control.BarTextColor != null?Control.BarTextColor.ToUIColor() : null;

            UIColor unselectionColor = Control.UnselectedTextColor != null?Control.UnselectedTextColor.ToUIColor() : null;

            if (selectionColor != null)
            {
                TabBar.SelectedImageTintColor = selectionColor;
            }

            if (unselectionColor != null)
            {
                TabBar.UnselectedItemTintColor = unselectionColor;
            }

            TabBar.Translucent = Control.TranslucideBarOniOS;

            var items = TabBar.Items;

            for (var i = 0; i < items.Length; i++)
            {
                #region UNUSED (iOS load icon automatically actually)

                //string icon = Control.GetIconAtIndex(i);
                //if (icon == string.Empty)
                //    continue;

                ////PNG Ressource don't need explicit extension
                //if (Path.GetExtension(icon).ToLowerInvariant() == ".png")
                //    icon = Path.GetFileNameWithoutExtension(icon);

                //items[i].Image = UIImage.FromBundle(icon);
                //items[i].SelectedImage = UIImage.FromBundle(icon);

                #endregion

                if (selectionColor != null)
                {
                    UITextAttributes selectedColorAttribute = new UITextAttributes();
                    selectedColorAttribute.TextColor = selectionColor;

                    items[i].SetTitleTextAttributes(selectedColorAttribute, UIControlState.Selected);
                }

                if (unselectionColor != null)
                {
                    UITextAttributes unselectedColorAttribute = new UITextAttributes();
                    unselectedColorAttribute.TextColor = unselectionColor;

                    items[i].SetTitleTextAttributes(unselectedColorAttribute, UIControlState.Normal);
                }

                if (Control.HideText)
                {
                    //Hiding current text

                    items[i].Title       = @"";
                    items[i].ImageInsets = new UIEdgeInsets(6, 0, -6, 0);
                }
            }

            base.ViewDidAppear(animated);
        }