Created
September 19, 2021 19:29
-
-
Save devDeejay/5a2aa0c098c7f6bb163be6243b856409 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
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