Skip to content

Instantly share code, notes, and snippets.

@hiteshchopra11
Created March 6, 2022 07:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hiteshchopra11/7ff02f320895b8a2797e7afbafcdb8b3 to your computer and use it in GitHub Desktop.
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