oneHamidreza / MeowBottomNavigation

Android Meow Bottm Navigation
http://etebarian.com
1.34k stars 200 forks source link

How to set the a new icon when a model is selected. #59

Closed ayushmaniac closed 4 years ago

ayushmaniac commented 4 years ago

How would I set an icon on selection of any cell instead of changing its color? I tried doing it in a way like this, but didn't work

  setOnShowListener {
               when (it.id) {
                    ID_HOME -> changeIconAndText(ID_HOME, R.drawable.home_select, getString(R.string.home))

and inside this changeIconAndText

val bottom = bottomNavigationView.getModelById(id)
                bottom?.apply {
                    icon = drawable
                }
oneHamidreza commented 4 years ago

Use v1.3.0 . I tested and it worked. use getCellById(id) function.