Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
PreviewParameterDemoTheme {
Greeting(name = "viewers")
}
}
}
}
@Composable
fun Greeting(name: String) {
Text(text = "Hello $name!")
}
@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
Greeting("Android")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment