Android Floating Action Button
Floating Action Button:
Floating Action Button (FAB) is one of the kinds of buttons usually applied in the interface for the most important actions.
It is often a round button featuring an image at its center; commonly located above the UI to encourage the primary function of an application.
This widget is normally located in a certain section of the screen with the aim of helping the user easily and quickly access an action that is frequently used, making the primary action standout.
Example:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FloatingActionButtonExample"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is the Floating Action Button"
android:textColor="@color/colorOrange"
android:textSize="20sp"
android:layout_marginTop="20dp"
android:layout_centerInParent="true"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/floating_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/ic_home_black_24dp"
/>
</RelativeLayout>
Output