New to android programming & struggling with right now. I\'m using android studio\'s default \"Navigation Drawer Activity\". On top of that, I\'ve added a Bottom Bar from <
Here is a solution that works for our use case. Basically we wanted to hide bottom navigation view and the fab that belongs to it whenever the user scrolls in the screen.
For that purpose we have decided to use the app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
that comes out of the box for BottomNavigationView
. All that is left is to anchor the fab to the BottomNavigationView
and use the same layout_behavior
on fab, too.
Here is an example of it:
Other than that you can define your own layout_behavior for fab as explained in GitHub: BlogPosts / android-coordinatorlayout-scrolling-hide-fab-behavior.md too.
I hope that it helps :)