Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Bottom Navigation Bar with drop shadow

Tags:

I'm implementing Bottom Navigation Bar in Android app using Google's support design library v25.1.0. Is there any way to add drop shadow effect, same as current Android native Google Photos app?

enter image description here

like image 863
Jan Slominski Avatar asked Jan 14 '17 13:01

Jan Slominski


1 Answers

You can draw your own shadow just above the bottom bar using simple View and its background:

<View     android:layout_width="match_parent"     android:layout_height="4dp"     android:layout_above="@id/bottom_bar"     android:background="@drawable/shadow"/> 

drawable/shadow.xml:

<shape xmlns:android="http://schemas.android.com/apk/res/android">     <gradient         android:startColor="#1F000000"         android:endColor="@android:color/transparent"         android:angle="90" /> </shape> 

Also, there are no compatibility issues if use this approach.

like image 155
Alexander Bilchuk Avatar answered Oct 04 '22 16:10

Alexander Bilchuk