FloatingActionButton

suggest change

Versions

This topic was documented for Android 3.0 through 7.1. The design-library FloatingActionButton itself arrived with the Design Support Library.

Introduction

A floating action button is the promoted action on a screen. By default it animates in as an expanding piece of material. The icon inside it can animate, and the button can move differently from other UI because it is the primary action. That action can run in place or open another screen.

Parameters

Parameter Detail
app:elevation Elevation of the FAB, as a dimension.
app:fabSize Size of the FAB.
app:rippleColor Ripple color of the FAB.
app:useCompatPadding Enables compat padding.

Declare xmlns:app="http://schemas.android.com/apk/res-auto" on the root element.

Remarks

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.

Only one floating action button is recommended per screen to represent the most common action.

Before using the FloatingActionButton you must add the design support library dependency in the build.gradle file:

dependencies {
    compile 'com.android.support:design:25.1.0'
}

Official Documentation:

https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html

Material Design Specifications:

https://material.google.com/components/buttons-floating-action-button.html

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents