Last active
February 18, 2024 07:24
-
-
Save rmyhal/272ce38b702fde9cf1d562ca5691c4ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| private fun FabContent( | |
| modifier: Modifier = Modifier, | |
| ) { | |
| var containerState by remember { mutableStateOf(ContainerState.Fab) } | |
| AnimatedContent( | |
| modifier = modifier, | |
| targetState = containerState, | |
| label = "container transform", | |
| ) { state -> | |
| when (state) { | |
| ContainerState.Fab -> Fab( | |
| modifier = Modifier | |
| .padding(end = 16.dp, bottom = 16.dp), | |
| onClick = { containerState = ContainerState.Fullscreen } | |
| ) | |
| ContainerState.Fullscreen -> AddContentScreen( | |
| onBack = { containerState = ContainerState.Fab } | |
| ) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment