I ended up using this solution.
Step 1
Create a shape_drawable.xml
file in the drawable folder as shown below:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#1F000000"
android:endColor="@android:color/transparent"
android:angle="90" />
</shape>
Step 2
Create a View
, set the shape_drawable.xml
as its background and then place the view just above the BottomAppBar.
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_above="@id/bottom_bar"
android:background="@drawable/shape_drawable"/>