Closed aalap03 closed 6 years ago
i have the same issue here
Has anyone found its solution.. ??
Since this is very useful library and I really enjoy working with it, I am still trying to solve it and reading method descriptions and tried these combinations but still no impact. Image is there just to show what I need and what is happening.
bottomNavigation.enableItemAtPosition(SECURITY);
// true gives me bigger icon (as selected) but not the color which I want, colour is still on first item.
bottomNavigation.setCurrentItem(SECURITY, true);
bottomNavigation.setAccentColor(ContextCompat.getColor(this, R.color.colorPrimary));
bottomNavigation.setInactiveColor(ContextCompat.getColor(this, R.color.black));
bottomNavigation.refresh();
bottomNavigation.restoreBottomNavigation();
Be sure to call setCurrentItem()
at the right moment. In the demo project, if you add bottomNavigation.setCurrentItem(2);
at the end of initUI()
, everything works fine.
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 ?