Make FAB not to be clipped inside bottom navigation bar

Viewed 4754

i'm trying to overlap the bottom navigation bar with a FAB. I want my navigationbar to look like this:

Desired result

But instead it cuts off the button like so:

current result

How do I prevent the FAB from being cut off? Here's my XML:

<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.mobgen.designsprintapp.ui.main.MainActivity">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

        <android.support.design.widget.BottomNavigationView
            android:id="@+id/navigation"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:background="?android:attr/windowBackground"
            android:backgroundTint="@color/colorPrimary"
            app:itemBackground="@color/colorPrimary"
            app:itemIconTint="@color/nav_item_color_state"
            app:itemTextColor="@android:color/black"
            app:menu="@menu/navigation" >

            <android.support.design.widget.FloatingActionButton
                android:id="@+id/tools"
                android:layout_width="56dp"
                android:layout_height="56dp"
                android:layout_gravity="center"
                android:layout_marginBottom="8dp"
                android:elevation="6dp"
                android:scaleType="center"
                app:srcCompat="@drawable/play" />
            </android.support.design.widget.BottomNavigationView>
    </LinearLayout>
</android.support.design.widget.CoordinatorLayout>
3 Answers

Just add

 app:elevation="10dp"

inside FloatingActionButton

Related