Tutorial by Examples

To use a FloatingActionButton just add the dependency in the build.gradle file as described in the remarks section. Then add to the layout: <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" ...
To show and hide a FloatingActionButton with the default animation, just call the methods show() and hide(). It's good practice to keep a FloatingActionButton in the Activity layout instead of putting it in a Fragment, this allows the default animations to work when showing and hiding. Here is an ...
Starting with the Support Library version 22.2.1, it's possible to show and hide a FloatingActionButton from scrolling behavior using a FloatingActionButton.Behavior sublclass that takes advantage of the show() and hide() methods. Note that this only works with a CoordinatorLayout in conjunction wi...
You can set the behavior of the FAB in XML. For example: <android.support.design.widget.FloatingActionButton app:layout_behavior=".MyBehavior" /> Or you can set programmatically using: CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fab.getLayoutPara...

Page 1 of 1