Created
September 19, 2021 19:38
This file contains hidden or 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") | |
} | |
} | |
// To Live Preview This | |
@Composable | |
fun GreetUser(name: String) { | |
Text(text = "Hello $name!") | |
} | |
// We annotate this one with | |
// @Preview | |
@Preview | |
@Composable | |
fun PreviewGreetUser() { | |
// Calling our function | |
// which we want to Preview | |
GreetUser("Medium") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment