Skip to content

Instantly share code, notes, and snippets.

@devDeejay
Created September 19, 2021 19:29
Show Gist options
  • Save devDeejay/5a2aa0c098c7f6bb163be6243b856409 to your computer and use it in GitHub Desktop.
Save devDeejay/5a2aa0c098c7f6bb163be6243b856409 to your computer and use it in GitHub Desktop.
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
// Calling our Refactored function
GreetUser("DEEJAY")
}
}
// We annotate it with @Composable
// To make it a Composable Function
@Composable
fun GreetUser(name: String) {
Text(text = "Hello $name!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment