I have a bottom navigation view in my Main Activity and I want to change it to show the icon and the text only for the selected item and to show only the icons of the other 2 items. I had an idea to change it in the code on click and set the other to items to empty string with this code:
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.navigation_home:
//set text to home
return true;
case R.id.navigation_dashboard:
//set to empty string
return true;
case R.id.navigation_notifications:
//set to empty string
return true;
}
return false;
}
But I can't get to the textview of the item from the code... What can I do?