It is necessary to position the button, so that it would be as in the figure:

enter image description here

Now the button is incorrectly located:

enter image description here

Now the layout looks like this:

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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" android:orientation="vertical"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="56dp" android:background="@color/colorMain" android:titleTextColor="@color/colorWhite" app:subtitleTextColor="@color/colorWhite"></android.support.v7.widget.Toolbar> <RelativeLayout android:id="@+id/rvGroupDescription" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/toolbar" android:background="@color/colorWhite"> <android.support.design.widget.FloatingActionButton android:id="@+id/fbtIcon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="20dp" android:src="@drawable/ic_camera_alt_white_24dp" app:backgroundTint="@color/colorGreyTransparent" /> <EditText android:id="@+id/etGroupName" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="10dp" android:layout_marginTop="20dp" android:layout_toLeftOf="@+id/imgSmile" android:layout_toRightOf="@+id/fbtIcon" android:backgroundTint="@color/colorMain" android:textCursorDrawable="@color/colorMain" /> <ImageView android:id="@+id/imgSmile" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginTop="20dp" android:background="@drawable/ic_tag_faces_24dp" android:padding="20dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/fbtIcon" android:layout_marginBottom="20dp" android:layout_marginLeft="20dp" android:text="@string/activity_group_description_icon" /> </RelativeLayout> <RelativeLayout android:id="@+id/rvParticipants" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/rvGroupDescription"> <android.support.design.widget.FloatingActionButton android:id="@+id/fbtDone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_below="@+id/tvQuantity" android:layout_marginRight="20dp" android:layout_marginTop="-60dp" android:src="@drawable/ic_check_24dp" app:backgroundTint="@color/colorMain" /> <TextView android:id="@+id/tvParticipants" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:layout_marginTop="15dp" android:text="@string/activity_group_description_participants" /> <TextView android:id="@+id/tvQuantity" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:layout_marginTop="15dp" android:layout_toRightOf="@+id/tvParticipants" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fbtParticipant" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/tvQuantity" android:layout_margin="20dp" android:src="@drawable/ic_account_grey" app:backgroundTint="@color/colorGreyTransparent" /> <TextView android:id="@+id/tvName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/fbtParticipant" android:layout_marginLeft="20dp" /> </RelativeLayout> </RelativeLayout> 

    1 answer 1

    Use CoordinatorLayout and anchor

     <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.4" 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.6" android:background="@android:color/holo_orange_light" android:orientation="horizontal"/> </LinearLayout> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" android:clickable="true" android:src="@drawable/ic_done" app:layout_anchor="@id/viewA" app:layout_anchorGravity="bottom|right|end"/> </android.support.design.widget.CoordinatorLayout> 

    The app:layout_anchor="@id/viewA" attribute app:layout_anchor="@id/viewA" FAB to Layout with @id/viewA . The app:layout_anchorGravity attribute app:layout_anchorGravity means that the button will stick in the lower right corner.

    Result

    enter image description here