Design a stylish Bottom Navigation Bar on Android

Bottom navigation bar make it easy for users to explore and switch between top-level views in a single tap. It should be used when application has three to five top-level destinations. In this post, we are going to create a stylish bottom navigation bar in Java but using a Kotlin library.

Add dependencies

We require the Kotlin dependency in order to use the library in our Java project.

Designing our menu

Create a new menu directory
Create a new menu directory

Right-click on the menu directory and create a new Menu Resource file and name it menu_bottom.xml

You can get the icons from the Vector drawables.

Next, we need a design for our menu that we can put as its background. So, right-click on the drawable directory and create a new drawable resource file and name it bubble.xml . Add the following code:

For the color you can set any but I’ll stick to the default for simplicity.

For the final design part, head over to your activity_main.xml and add the following:

Main Activity

The outcome:

The outcome of our activity should be similar to this
The outcome of our activity should be similar to this

There are various methods that we can implement in this library but not for now. We could for example set a chipNavigationBar. setOnItemSelectedListener method to set intents for when a different menu item is selected. However, that’s all for now. I have hosted this repository on GitHub here. Happy coding!

I write content on Android and Web technologies. Currently focusing on Cybersecurity. Find me on liciolentimo.com