Android FloatingActionButton

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

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.

Parameters

ParameterDetail
android.support.design:elevationElevation 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:fabSizeSize for the FAB.
android.support.design:rippleColorRipple color for the FAB.
android.support.design:useCompatPaddingEnable compat padding.

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



Got any Android Question?