This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MorphingFab(modifier: Modifier = Modifier) { | |
val users = remember { mutableStateListOf<User>() } | |
// 1 | |
var showDialog by remember { mutableStateOf(false) } | |
// 2 | |
SharedTransitionLayout( | |
modifier = Modifier | |
.fillMaxSize(), | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
@Composable | |
fun InputBox( | |
onAddUser: (User) -> Unit, | |
onCancel: () -> Unit, | |
modifier: Modifier = Modifier, | |
) { | |
// 2 | |
Card( | |
modifier = modifier, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class User( | |
val name: String, | |
val email: String, | |
) | |
@OptIn(ExperimentalSharedTransitionApi::class) | |
@Composable | |
fun MorphingFab(modifier: Modifier = Modifier) { | |
val users = remember { mutableStateListOf<User>() } | |
var showDialog by remember { mutableStateOf(false) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun MorphingFab(modifier: Modifier = Modifier) { | |
val users = remember { mutableStateListOf<User>() } | |
Box(modifier = modifier) { | |
UserList( | |
users = users, | |
modifier = Modifier.fillMaxSize(), | |
) | |
InputBox( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FloatingActionButton( | |
modifier = Modifier | |
.align(Alignment.BottomEnd) | |
.padding(all = 16.dp), | |
onClick = { | |
// TODO | |
} | |
) { | |
Icon( | |
imageVector = Icons.Default.Add, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
data class User( | |
val name: String, | |
val email: String, | |
) | |
// 2 | |
@Composable | |
fun UserList( | |
users: List<User>, |
NewerOlder