In this post we will talk about Floating Action Button.

Floating action buttons are used for a promoted action. They are distinguished by a circled icon floating above the UI and have motion behaviors that include morphing, launching, and a transferring anchor point.

Floating action buttons come in two sizes:

  • Default size: For most use cases
  • Mini size: Only used to create visual continuity with other screen elements

different size of fab
For change size of button need to use fabSize attribute with value: mini or normal.

Firstly need to add library or add dependency for gradle.
dependencies {
compile ‘’

Next step is adding floating action button to layout.


After it need to update Activity.
public class FABActivity extends ActionBarActivity implements View.OnClickListener {

public void onCreate(Bundle savedInstanceState) {


public void onClick(View v) {
Snackbar.make(findViewById(, “TEST”, Snackbar.LENGTH_SHORT).show();

Unfortunately Snackbar lock floating action button.

snackbar locked fab

For fix this problem need to use CoordinatorLayout.


After it all works correctly.

1 CommentClose Comments

Leave a comment

Newsletter Subscribe

Get the Latest Posts & Articles in Your Email

We Promise Not to Send Spam:)