Multi Floating Action Button

Android library providing an implementation of the Material Design Floating Action Button Speed Dial.

Features

  • Main Floating Action Button expands into multiple Small Floating Action Buttons
  • Highly customizable (label, icon and background colors, themes support)
  • Easy to use

How to use

Gradle setup

Official releases

The library is available on JitPack. To add the dependency in your project:

Step 1. Add the JitPack repository to your root build.gradle at the end of repositories:

	allprojects {
        repositories { 
            //...
            maven { url 'https://jitpack.io' }
        }
    }

Step 2. Add the dependency entry (latest version on JitPack):

    dependencies {
        implementation 'com.github.lemillion12:multi-floating-action-button:1.0.0'
    }

Basic use

Multi Floating Action Button

Use the MultiFloatingActionButton constructor to create your composable:

@Composable
fun SpeedDial() {
    val fabItems = listOf(
        FabItem(
            Icons.Filled.ShoppingCart,
            "Shopping Cart"
        ) { /*TODO*/ },
        FabItem(
            Icons.Filled.Favorite,
            "Favorite"
        ) { /*TODO*/ }
    )
    MultiFloatingActionButton(
        fabIcon = Icons.Filled.Add,
        items = fabItems,
        showLabels = true
    )
}

Credits

This project is based on ComposeCompanion by ComposeAcademy.

GitHub

View Github