Droppers / AnimatedBottomBar

A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.
MIT License
1.37k stars 109 forks source link

Add function to set icons programatically #30

Closed russellbanks closed 3 years ago

russellbanks commented 3 years ago

It would be great to have the feature to set icons for the bottom bar programmatically as it would mean that any third party libraries such as Android Iconics can be utilised so that drawable resources do not have to be used in XML and can be created programmatically instead.

bottomBar.tabs[i].icon = customIcon currently says Val cannot be reassigned.

Droppers commented 3 years ago

You can already pass a drawable to the createTab() function, do you mean changing the tab icon after it has been created?

It cannot be reassigned since the BottomBar won't know that the icon property has been changed, therefore will still show the old icon.

russellbanks commented 3 years ago

Thank you for your reply. Although this didn't work for me, it was what I was looking for :)