Curved bottom navigation Android tutorial (Java/Kotlin)

Last Updated on April 15, 2021 by Vinay Kharayat

Welcome, In today’s post I will be sharing “Curved bottom navigation Android tutorial (Java/Kotlin)” a programming tutorial for Android developers who wish to add this cool Curved Bottom Navigation in their Android Application.

Curved bottom navigation demo

  • Knowledge of Navigation Component(for Navcontroller)
  • Knowledge of Animated Vector Drawables

So, let move to the tutorial. I am using Android Studio for this tutorial.

Also Read: Watch free movies and web shows

Curved Android Bottom Navigation Tutorial:

First of all, we need to add a dependency for curved bottom navigation bar for android, developed by Suson Thapa. This post is inspired by his medium blog post, but that was only for Kotlin and I thought maybe I should write tutorial for Java developers. If you are a Kotlin Developer just visit Github Repository of this library.

To add the library add the following code to app level build.gradle file:

implementation ''

Now add the following code to project level build.gradle file:

allprojects {
    repositories {
        maven {
            url  ""

Now open file and all the following code(ignore if already exits):


Then open the layout file in which you want to add Curved Bottom Navigation. For example: activity_main.xml and add the following code:

    android:layout_height="wrap_content" />

Now open file and inside onCreate() method add the following code:

CurvedBottomNavigationView cbn = findViewById(;
CbnMenuItem notification = new CbnMenuItem(R.drawable.vd_notifications, R.drawable.avd_notifications,;
CbnMenuItem newOrder = new CbnMenuItem(R.drawable.vd_add, R.drawable.avd_add,;
CbnMenuItem profile = new CbnMenuItem(R.drawable.vd_profile, R.drawable.avd_profile,;
CbnMenuItem[] navigation_items = {notification,newOrder,profile};
cbn.setMenuItems(navigation_items, 1);

In the above code inside CbnMenuItem(), I passed three parameters. The first parameter is normal vector drawable, the second parameter is Animated Vector drawable (you can visit to create animated vector drawable), and the third parameter I passed is the id of the fragment.

Now in the last line of code, we have used the Navigation Controller for navigation because it makes it very easy and convenient. If you don’t know how you use it, I would recommend you to learn and believe me it is very easy.

But still if you want alternate way, you can use listeners for handling the click events of Curved Bottom Navigation.


I haven’t actually used the onMenuItemListener() as it was confusing, instead I used NavController to do the job.

So this was it guys for bottom navigation android tutorial, if you have any doubts just ask in comment section, I would love to help you.

3 thoughts on “Curved bottom navigation Android tutorial (Java/Kotlin)”

  1. Hi,

    I trust you are well. I have followed your example but stuck at this error!

    Caused by: java.lang.IllegalStateException: You must call setGraph() before calling getGraph()

    What could be the problem

    • You have to create Navigation Graph and set that graph to NavHostFragment. To create navigation graph. right click on layout folder and create new resource folder, just like you do for menu. Add NavHostFragment into your activity_main.xml.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.