コード例 #1
0
 public OnClickListenerAnonymousInnerClass(BottomNavigationBar outerInstance)
 {
     this.outerInstance = outerInstance;
 }
コード例 #2
0
        /// <summary>
        /// Used to get set data to the Tab views from navigation items
        /// </summary>
        /// <param name="bottomNavigationItem"> holds all the data </param>
        /// <param name="bottomNavigationTab">  view to which data need to be set </param>
        /// <param name="bottomNavigationBar">  view which holds all the tabs </param>
        public static void bindTabWithData(BottomNavigationItem bottomNavigationItem, BottomNavigationTab bottomNavigationTab, BottomNavigationBar bottomNavigationBar)
        {
            Context context = bottomNavigationBar.Context;

            bottomNavigationTab.Label = bottomNavigationItem.getTitle(context);
            bottomNavigationTab.Icon  = bottomNavigationItem.getIcon(context);

            int activeColor   = bottomNavigationItem.getActiveColor(context);
            int inActiveColor = bottomNavigationItem.getInActiveColor(context);

            if (activeColor != -1)
            {
                bottomNavigationTab.ActiveColor = activeColor;
            }
            else
            {
                bottomNavigationTab.ActiveColor = bottomNavigationBar.ActiveColor;
            }

            if (inActiveColor != -1)
            {
                bottomNavigationTab.InactiveColor = inActiveColor;
            }
            else
            {
                bottomNavigationTab.InactiveColor = bottomNavigationBar.InActiveColor;
            }

            if (bottomNavigationItem.InActiveIconAvailable)
            {
                Drawable inactiveDrawable = bottomNavigationItem.getInactiveIcon(context);
                if (inactiveDrawable != null)
                {
                    bottomNavigationTab.InactiveIcon = inactiveDrawable;
                }
            }

            bottomNavigationTab.ItemBackgroundColor = bottomNavigationBar.BackgroundColor;

            setBadgeForTab(bottomNavigationItem.BadgeItem, bottomNavigationTab);
        }