I am new to Android development. I am trying to have a bottom navigation view similar to below attached image
With a background color of selected menu and also a middle button to be overflow over nav bar. Few key points to note in this is:
If any tutorial or any guidance available then let me know.
Thank you (in advance)
Very easy solution. Simply use ConstraintLayout. Align the bottom edge of top view to the top edge of bottom view.
There are two ways to style the navigation bar depends on how you create it. One is using the XML style file if you create the navigation bar from XML. The other one is to change it using code.
Use the SpaceNavigationView library to get the Bottom Navigation Bar similar to your required design. The library has the option for an overflow icon in the center and also there is no title with icons. However, I am not sure if the is any background color change feature on selection of tab in the library. You can also take a look at other libraries and see if the source codes can be of any help.
https://github.com/armcha/Space-Navigation-View
https://github.com/aurelhubert/ahbottomnavigation
https://github.com/sephiroth74/Material-BottomNavigation
https://github.com/Ashok-Varma/BottomNavigation
I can answer about guidance.
Check BottomNavigationView documentation. Play with OnTabSelectListener to change background color on selection. Play with dynamic items adding, to make your central item overflown.
Before BottomNavigationView
was added to Android SDK, some kind peron wrote BottomBar library. This library implements even more, then BottomNavigationView
, including background color change. Its source code might be helpful for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With