Floating Action Button (FAB)

Floating Action Buttons are used for a special type of promoted action. They are distinguished by a circled icon floating above the UI and have special motion behaviors related to morphing, launching, and the transferring anchor point.

Floating action buttons come in two sizes: the default and mini. The size can be controlled with the FABSize attribute. As this class descends from ImageView, you can control the icon that is displayed via setImageDrawable(Drawable).

The background color of this view defaults to your theme's colorAccent. If you wish to change this at runtime, you can do so via setBackgroundTintList(ColorStateList).

The FAB could be used to carry out different kinds of transitions on click. The following ...

Get Expert Android Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.