aurelhubert / aurelhubert/ahbottomnavigation

change color for inactive items doesn't work

Open
#333 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.8k
Forks
672
PR merge metrics
No merged PRs in 30d

Description

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);

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue using the AHBottomNavigationItem setup and the calls to setColoredModeColors, setInactiveColor, and setForceTint shown in the report. Trace how inactive-item colors are selected, then verify that the configured bottom_navigation_inactive color is applied to inactive items without changing the selected color.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.