android multi-fab that made with jetpack-compose
implementation "io.github.jisungbin:multifab:${version}"
@Composable
fun MultiFloatingActionButton(
modifier: Modifier = Modifier,
items: List<MultiFabItem>,
fabState: MutableState<MultiFabState> = rememberMultiFabState(),
fabIcon: FabIcon,
fabOption: FabOption = FabOption(),
onFabItemClicked: (fabItem: MultiFabItem) -> Unit,
stateChanged: (fabState: MultiFabState) -> Unit = {}
)
/**
* @param id Cannot be duplicated with the [id] value of another [MultiFabItem].
*/
data class MultiFabItem(
val id: Int,
@DrawableRes val iconRes: Int,
val label: String = ""
)
/**
* Affects all fabs including sub fabs.
*/
@Composable
fun FabOption(
backgroundTint: Color = MaterialTheme.colors.secondary,
iconTint: Color = contentColorFor(backgroundTint),
showLabels: Boolean = false
): FabOption
/**
* Affects the main fab icon.
*
* @param iconRes [MultiFloatingActionButton]'s main icon
* @param iconRotate If is not null, the [iconRes] rotates as much as [iconRotate] when [MultiFloatingActionButton] is in [MultiFabState.Expand] state.
*/
fun FabIcon(@DrawableRes iconRes: Int, iconRotate: Float? = null): FabIcon