I have a CoordinatorLayout that contains a BottomNavigationView and an AppBarLayout with a ToolBar inside of it. (The BottomNavigationView is not inside the AppBarLayout, as doing it breaks the position of the BottomNavigationView).
I need to show/hide the AppBarLayout and the BottomNavigationView programmatically, when certain events happen (e.g. on a fragment's onResume), and so far I've managed setting appBarLayout.setExpanded(true, true) in order to show/hide the AppBar, but I can't figure out how to do the same for the BottomNavigationView, as it does not have any method to show/hide itself.
The behaviour of my BottomNavigationView is app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior", set in the layout xml. How can I get a reference to this behaviour in my code in order to manage its expanded/collapsed state?