How can I add the new “Floating Action Button” between two widgets/layouts

Best practice: Add compile ‘com.android.support:design:25.0.1’ to gradle file Use CoordinatorLayout as root view. Add layout_anchorto the FAB and set it to the top view Add layout_anchorGravity to the FAB and set it to: bottom|right|end <android.support.design.widget.CoordinatorLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent”> <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <LinearLayout android:id=”@+id/viewA” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_weight=”0.6″ android:background=”@android:color/holo_purple” android:orientation=”horizontal”/> <LinearLayout android:id=”@+id/viewB” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_weight=”0.4″ … Read more