Floating action button is used for a special type of promoted action,it animates onto the screen as an expanding piece of material, by default. The icon within it may be animated,also FAB may move differently than other UI elements because of their relative importance. A floating action button represents the primary action in an application which can simply trigger an action or navigate somewhere.
Parameter | Detail |
---|---|
android.support.design:elevation | Elevation value for the FAB. May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name". |
android.support.design:fabSize | Size for the FAB. |
android.support.design:rippleColor | Ripple color for the FAB. |
android.support.design:useCompatPadding | Enable compat padding. |
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'
}
https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html
https://material.google.com/components/buttons-floating-action-button.html