aurelhubert / ahbottomnavigation

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

color of selected item is not changing #294

Closed Ayesha-Fazal closed 6 years ago

Ayesha-Fazal commented 7 years ago

is it possible to change the color of selected item in bottom navigation although i am using AHBottomNavigation

Current Behaviour: I have 5 items in bottom navigation view, by default 1st item is coloured (Active or enable) when user comes here first.

Goal: In one scenario user can come to the app from notification and lands on 4th fragment. I want to make 4th fragment (3rd position in bottom view) coloured.

Issue: I tried using setCurrentItem(3) but still shows first item coloured. Also tried bottomNavigation.enableItemAtPosition(3); but same result.

How to make this work ?

aurelhubert commented 6 years ago

setCurrentItem should work, but be sure to execute the code when the view is already displayed.

gnahum12345 commented 6 years ago

setCurrentItem doesn't work...

I have it such that when I click on a different tab, the fragment changes (and that works) but the bottomNavigation stays at its initial state.