Skip to content

Instantly share code, notes, and snippets.

@fvilarino
Last active April 26, 2024 02:53
Show Gist options
  • Save fvilarino/80ae01548cccdb2335019f4dbab0de2b to your computer and use it in GitHub Desktop.
Save fvilarino/80ae01548cccdb2335019f4dbab0de2b to your computer and use it in GitHub Desktop.
Container Transform - Baseline
@Composable
fun MorphingFab(modifier: Modifier = Modifier) {
val users = remember { mutableStateListOf<User>() }
Box(modifier = modifier) {
UserList(
users = users,
modifier = Modifier.fillMaxSize(),
)
InputBox(
onAddUser = {
users.add(it)
},
onCancel = { /* TODO */ },
modifier = Modifier
.align(Alignment.Center)
.width(320.dp)
.shadow(elevation = 4.dp),
)
FloatingActionButton(
modifier = Modifier
.align(Alignment.BottomEnd)
.padding(all = 16.dp),
onClick = {
// TODO
}
) {
Icon(
imageVector = Icons.Default.Add,
contentDescription = "Add",
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment