title.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width ="match_parent"
>
<TextView
android:id="@+id/titleText"
android:layout_width="match_parent"
android:layout_height="60dp"
android:gravity="center"
android:text="@string/title_text"
android:textColor="#fff"
android:background="@color/design_default_color_primary"
android:textSize="24sp" />
<Button
android:id="@+id/titleBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@color/design_default_color_background"
android:text="@string/back"
android:textColor="#fff" />
<Button
android:id="@+id/titleEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_gravity="end"
android:background="@color/cardview_light_background"
android:text="@string/edit"
android:textColor="#fff" />
</FrameLayout>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width ="match_parent">
<include layout="@layout/title" />
</LinearLayout>