Creating bottom navigation view in Android application

Creating bottom navigation view in Android application

Today we are going to learn how to create Android bottom navigation view which makes applications functions easily accessible to the user by just one click.

Let get started.

We are going to create a new Project in Android Studio and name it as “BottomNavigation

Creating bottom navigation view in Android application

 

Select Android Minimum SDK Version

 

Create Empty Activity.

 

Make sure to select generate Layout file and also BackWards compatibility.This makes sure that your application is

compatible with previous devices.

After creating the project,its time now to add com.android.support:design:26.1.0 dependency to  our buid.gradle file.

Open the build.gradle and add below code.

Add Home and notifications drawables to your project resources.drawables

Next, we are going to create Menu resource that will have Item for the bottom navigation.

 

 

Open activity_main.xml and add below code

MainActivity.java code

Running the application now and below screen should appear in your emulator.

bottom-navigation-example

We can modify the appearance of the Navigation Menu by changing the colors and Icon colors and text.

 

Output

 

Let now create some fragments that will be loaded once we click on the Home and Notifications icons.

HomeFragment.java

fragment_home.xml

NotificationFragment.java

fragment_notification.xml

Download Source code

About the Author: Eric K

My name is Eric.Am a software developer with skills in Php,Mysql, Java , Android,Node.js Above all, I have certification in Cisco Networking Associate (CCNA) and holds degree in Information Technology. Hire me: Email : kawi3462@gmail.com