Trying to achieve color change in menu when clicked buttom navigation items.
here is my xml code
<com.google.android.material.bottomnavigation.BottomNavigationView
app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="56dp"
android:elevation="@dimen/_10sdp"
android:background="@color/white"
app:menu="@menu/bottom_menu"
app:itemTextColor="@color/button_navigation"
app:itemIconTint="@color/button_navigation">
</com.google.android.material.bottomnavigation.BottomNavigationView>
here is my activity code
viewBinding.navigation.setOnNavigationItemSelectedListener { item ->
when (item.itemId) {
R.id.homeBottom->{
addFragment(HomeFragment(),false)
}
R.id.notificationBottom->{
}
R.id.messageBottom->{
}
R.id.accountBottom -> {
addFragment(UserProfileFragment(), false)
}
}
false
}
Any suggestion will be Appreciated .Thank you