How to disable BottomNavigationView click and Touch?

Muhammad Aiman Bin Kamal picture Muhammad Aiman Bin Kamal · Oct 3, 2017 · Viewed 10.8k times · Source

i want to implement behavior on certain condition the bottom view is unable to click, i want to make if bottom view item being click it does not navigate to that item but still stay at the current item

this is my bottom view layout

Answer

ysfcyln picture ysfcyln · Nov 20, 2018

You can disable menu items if you want to disable bottom navigation view

private void enableBottomBar(boolean enable){
    for (int i = 0; i < mBottomMenu.getMenu().size(); i++) {
        mBottomMenu.getMenu().getItem(i).setEnabled(enable);
    }
}