aurelhubert / ahbottomnavigation

A library to reproduce the behavior of the Bottom Navigation guidelines from Material Design.
3.84k stars 683 forks source link

change color for inactive items doesn't work #333

Open fahime-ghasemi opened 6 years ago

fahime-ghasemi commented 6 years ago

I tried a lot but can't change the color of inactive items. they always have a gray color. this is my code

AHBottomNavigationItem homeItem = new AHBottomNavigationItem(R.string.home, R.drawable.ic_home, R.color.bottom_navigation); AHBottomNavigationItem aboutItem = new AHBottomNavigationItem(R.string.about, R.drawable.ic_about, R.color.bottom_navigation); AHBottomNavigationItem newsItem = new AHBottomNavigationItem(R.string.news, R.drawable.ic_activation_code_24dp, android.R.color.transparent); AHBottomNavigationItem profileItem = new AHBottomNavigationItem(R.string.profile, R.drawable.ic_profile, R.color.bottom_navigation);

    bottomNavigation.addItem(homeItem);
    bottomNavigation.addItem(aboutItem);
    bottomNavigation.addItem(newsItem);
    bottomNavigation.addItem(profileItem);
    bottomNavigation.setBehaviorTranslationEnabled(false);
    bottomNavigation.setTitleState(AHBottomNavigation.TitleState.ALWAYS_SHOW);

    bottomNavigation.setDefaultBackgroundResource(R.color.bottom_navigation);
    bottomNavigation.setColored(true);
    bottomNavigation.setAccentColor(R.color.toolbar);
    bottomNavigation.setForceTint(true);
    bottomNavigation.setColoredModeColors(getResources().getColor(R.color.toolbar),getResources().getColor(R.color.bottom_navigation_inactive));

    bottomNavigation.setInactiveColor(R.color.bottom_navigation_inactive);
hanssl commented 5 years ago

Same issue