-
-
Save walnashgit/1f300d4745483cdbd6277b67cdc5b2a8 to your computer and use it in GitHub Desktop.
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 Favorite(modifier: Modifier = Modifier, viewModel: MainViewModel) { | |
viewModel.setCurrentScreen(Screens.HomeScreens.Favorite) | |
val clickCount by viewModel.clickCount.observeAsState() | |
var click = clickCount?: 0 | |
Column( | |
modifier = modifier.fillMaxSize(), | |
verticalArrangement = Arrangement.Center, | |
horizontalAlignment = Alignment.CenterHorizontally | |
) { | |
Text(text = "Favorite.", style = MaterialTheme.typography.h4) | |
Button( | |
onClick = { | |
click++ | |
viewModel.updateClick(click) | |
} | |
) { | |
Text("clicked: $click") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment