Android library providing an implementation of the Material Design Floating Action Button Speed Dial.
- Main Floating Action Button expands into multiple Small Floating Action Buttons
- Highly customizable (label, icon and background colors, themes support)
- Easy to use
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'
}
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
)
}
Q. How do I change the color of the buttons?
A. This library leverages the colors from app theme specified using Material Design 3. The colors can be customized in the same way as for the FABs (refer: FAB Specs).
This project is based on ComposeCompanion by ComposeAcademy.