Example #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            fragmentRecipesCategories = new FragmentRecipesCategories();
            fragmentTopRecipes        = new FragmentTopRecipes();
            fragmentIngredients       = new FragmentIngredients();
            SupportFragmentManager.BeginTransaction().Add(Resource.Id.fragmentContainer, fragmentRecipesCategories, "RecipesCategories").Commit();
            currentFragment = fragmentRecipesCategories;
            SupportFragmentManager.BeginTransaction().Add(Resource.Id.fragmentContainer, fragmentTopRecipes, "TOP").Hide(fragmentTopRecipes).Commit();
            SupportFragmentManager.BeginTransaction().Add(Resource.Id.fragmentContainer, fragmentIngredients, "Ingredients").Hide(fragmentIngredients).Commit();

            _bottomBar = BottomBar.Attach(this, savedInstanceState);
            _bottomBar.SetItems(Resource.Menu.bottombar_menu);
            _bottomBar.SetOnMenuTabClickListener(this);
            // Setting colors for different tabs when there's more than three of them.
            // You can set colors for tabs in two different ways as shown below.
            _bottomBar.MapColorForTab(0, "#5D4037");
            _bottomBar.MapColorForTab(1, "#5D4037");
            _bottomBar.MapColorForTab(2, "#7B1FA2");
            //_bottomBar.MapColorForTab(3, "#FF5252");
            //_bottomBar.MapColorForTab(4, "#FF9800");
            //_bottomBar.Hide(false);//скрытие нижней панели
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Shifting);

            _messageView = FindViewById <TextView>(Resource.Id.messageView);

            _bottomBar = BottomBar.Attach(this, savedInstanceState);
            _bottomBar.SetItemsFromMenu(Resource.Menu.bottombar_menu, this);

            // Setting colors for different tabs when there's more than three of them.
            // You can set colors for tabs in two different ways as shown below.
            _bottomBar.MapColorForTab(0, Resources.GetColor(Resource.Color.colorAccent, Theme));
            _bottomBar.MapColorForTab(1, "#5D4037");
            _bottomBar.MapColorForTab(2, "#7B1FA2");
            _bottomBar.MapColorForTab(3, "#FF5252");
            _bottomBar.MapColorForTab(4, "#FF9800");
        }
Example #3
0
 private void SetTabColors()
 {
     if (Element == null)
     {
         return;
     }
     for (int i = 0; i < Element.Children.Count; ++i)
     {
         _bottomBar.MapColorForTab(i, Element.BarBackgroundColor.ToAndroid());
     }
 }
 private void SetTabColors()
 {
     for (var i = 0; i < Element.Children.Count; ++i)
     {
         var page     = Element.Children[i];
         var tabColor = page.GetTabColor();
         if (tabColor != null)
         {
             _bottomBar?.MapColorForTab(i, tabColor.Value.ToAndroid());
         }
     }
 }
        void SetTabColors()
        {
            for (int i = 0; i < Element.Children.Count; ++i)
            {
                Page page = Element.Children [i];

                Color tabColor = BottomBarPageExtensions.GetTabColor(page).ToAndroid();

                if (tabColor != Color.Transparent)
                {
                    _bottomBar.MapColorForTab(i, tabColor);
                }
            }
        }