armcha / armcha/Space-Navigation-View
Changing centre background color ?
- Dominant language
- Java
- Stars
- 2k
- Forks
- 376
- PR merge metrics
- No merged PRs in 30d
Description
My problem is about to change centre button's background color. When i click centre button, i'm changing it's icon but background color is not changing. How can i do this ?
Here is my code:
public void onCentreButtonClick(){
fragmentManager = getSupportFragmentManager();
if(isCentre){ //centre button is clicked or not.
isCentre = false;
bottom_nav.changeCenterButtonIcon(R.mipmap.p);
//Open some fragment
}
else {
isCentre = true;
bottom_nav.changeCenterButtonIcon(R.mipmap.p_active);
//Open centre fragment
}
final FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.container, fragment).commit();
}
And here is my bottom_nav configurations:
bottom_nav.setCentreButtonIconColorFilterEnabled(false);
bottom_nav.setCentreButtonIcon(R.mipmap.p);
bottom_nav.setCentreButtonColor(ContextCompat.getColor(context, R.color.bottom_nav_back));
bottom_nav.setInActiveSpaceItemColor(ContextCompat.getColor(context, R.color.bottom_nav_items));
bottom_nav.setActiveSpaceItemColor(ContextCompat.getColor(context, R.color.bottom_nav_items));
bottom_nav.setSpaceBackgroundColor(ContextCompat.getColor(context, R.color.bottom_nav_back));
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the library methods setCentreButtonColor and changeCentreButtonIcon from the provided configuration and click handler. Reproduce the click behavior, then inspect how the centre button background is applied; the issue is done when changing the centre icon also visibly changes its background color.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100