Floating Action Button for lower version

You can now use the FloatingActionButton from the support-design library. Add this dependency to your gradle build file:

compile 'com.android.support:design:22.2.0'

And then add the FloatingActionButton to your layout file:

 <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        android:layout_margin="@dimen/fab_margin"
        android:src="https://stackoverflow.com/questions/24605116/@drawable/ic_done" />

Example project from Chris Banes: https://github.com/chrisbanes/cheesesquare.

Leave a Comment