creativecoder
creativecoder

Reputation: 1540

Cannot resolve symbol 'BottomNavigationItemView' in androidx

I removed implementation 'com.android.support:design:28.0.0' and migrated to androidx implementation 'com.google.android.material:material:1.4.0-alpha01' I like to know what is the equivalent code for BottomNavigationItemView.

` public void hideOrShowBottomNavigationItem(int id, BottomNavigationView view, int visibility) {

    BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);
    for (int i = 0; i < menuView.getChildCount(); i++) {
        BottomNavigationItemView itemView = (BottomNavigationItemView) menuView.getChildAt(i);
        if (itemView.getId() == id) {
            itemView.setVisibility(visibility);
        }
    }
}` i am getting error cannot resolve BottomNavigationItemView

Upvotes: 0

Views: 370

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364451

Check the right imports in your project:

import com.google.android.material.bottomnavigation.BottomNavigationItemView
import com.google.android.material.bottomnavigation.BottomNavigationView

Upvotes: 1

Related Questions