Android Bottom Navigation Material Design with Example [Updated]

The Android Bottom Navigation View has been added to version 25 of the Design Support Library. Android Bottom navigation provides easy navigation for switching between 3 to 5 different views. It was a recently added to the Material Design spec, which provides an alternative between tabs and navigation drawers.

Android bottom navigation material design with example download

Android bottom navigation material design with example github

 

Adding the Bottom Navigation View to your layout

The first step is to add the design support library to your app-level build.gradle file.

compile ‘com.android.support:design:25.0.0’

Next, add the Bottom Navigation View widget to the layout file.

Important Attribute of BottomNavigationview,

app:menu — The menu resource file to display the navigation items along with icon and text.
app:itemBackground — Applies background color to bottom navigation.
app:itemTextColor — The text color for bottom navigation item.
app:itemIconTint — The icon color for bottom navigation item.


Retrofit Android Example With Recyclerview

Android Recyclerview Material Design with Example


Create a menu to display
Bottom Navigation items rendered using a menu file, create a new XML named navigation_menu.xml

Open the layout file of main activity activity_main.xml and add BottomNavigationView widget. Here we are also adding a FrameLayout to load the Fragments when the navigation item is selected.

BottomNavigationView selector for Enable / Disable

Set

app:itemTextColor="@drawable/nav_item_color"
app:itemIconTint="@drawable/nav_item_color"

in BottomNavigationView widget.

Listener for BottomNavigationView Item selection


Cardview Android Material Design with Example

Android Recyclerview Search Filter Example


Adding Fragment to BottomNavigationView Items

Load the fragment to the BottomNavigationView while OnNavigationItemSelectedListener.

Implementing the Fragment with Retrofit
Adding Retrofit dependencies,

ApiService.java

LatestRepo.java

latest_adapter.layout.xml

LatestRecyclerviewAdapter.java

latest_layout.xml

Finally, the LatestFragment.java


Related: Cardview Android Material Design with Example [Download]

Related: Android Recyclerview material design With Example [Download]

Related: Retrofit Android Example With Recyclerview [Download] 


Screenshot

bottom navigationview
bottom navigationview android example
bottom navigationview
bottom navigationview android example

2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to Top