question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bottom navigation items keep the primary color after de-selecting in some cases

See original GitHub issue

This is how I load the drawables per bottom navigation item:

Drawable drawable = null;

try {
    drawable = ResourcesCompat.getDrawable(getResources(),
            getResources().getIdentifier(menuItemInfo.ModuleDrawableName, "drawable", getPackageName()), null);
}
catch (Exception e) {
    e.printStackTrace();

    try {
        drawable = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_warning_black_24dp, null);
    }
    catch (Exception e2) {
        e2.printStackTrace();
    }
}

This is how it looks (and should look) when I start the app: http://i.imgur.com/rVm1Quj.jpg This is how it looks after I selected each bottom item from left to right: http://i.imgur.com/d8bupwC.jpg

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
roughikecommented, Sep 1, 2016

I see! I remember having that problem with the v1 as well.

The thing is, the “first generation” of BottomBar was (in my opinion) some horrible spaghetti code. It kinda worked, but was a real PITA to maintain, because the code was so messy. On top of that, it had no tests and that’s why some bugs were reintroduced after fixing other ones. Including that one you just described, which was (if I remember correctly) already fixed before.

I’m adding the support to inflate items dynamically to the new version when I can though, as it’s been requested many times.

0reactions
roughikecommented, Mar 26, 2017

I’ve decided that v1 will be discontinued, so I’m closing this one. Please switch to the latest versions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selected tab's color in Bottom Navigation View - Stack Overflow
BottomNavigationView uses colorPrimary from the theme applied for the selected tab and it uses android:textColorSecondary for the inactive tab ...
Read more >
Bottom navigation - Material Design
Bottom navigation bars allow movement between primary destinations in an app. Updated navigation bars have a new name, taller container height, active state ......
Read more >
Select worksheets - Microsoft Support
Select worksheets ; A single sheet. Click the tab for the sheet you want to edit. The active sheet will be a different...
Read more >
Select and Mask workspace - Adobe Support
The Select and Mask workspace features a combination of familiar and new tools: Quick Selection Tool: Make quick selections based on color and ......
Read more >
Hands-on with Material Components for Android: Bottom ...
The color of the BottomNavigationView navigation item icons/labels can be customized with the itemIconTint / itemTextColor attributes respectively. Typically ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found