Search code examples
androidfloating-action-button

Include Floating Action Button library


I am a beginner at Android Studio and using the following library https://github.com/futuresimple/android-floating-action-button to add Floating Action Button into my project but I don't know how to do that. Please guide me.


Solution

  • Updated for AndroidX:

    You can use Google's native implementation of FAB: com.google.android.material.floatingactionbutton.FloatingActionButton

    Dependency: com.google.android.material:material:1.0.0


    Previously (before AndroidX):

    I would suggest using the Design Support Floating Action Button supplied by Google instead as seen here http://android-developers.blogspot.com/2015/05/android-design-support-library.html add this to your gradle:

    dependencies {
        compile 'com.android.support:design:23.0.0'
    }
    

    and that will include the FloatingActionButton shown here: http://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html?utm_campaign=io15&utm_source=dac&utm_medium=blog

    It is generally a better practice to use a supported library than a 3rd party one.