Fix the preview function to be able to see the result of the written code.
Hello, Compose!
Fix preview
Report a typo
Write a program in Kotlin
@Preview
fun MessageInputPreview(text: String) {
HyperskillTheme {
val textLength = text.trim().count()
when {
textLength < 1 -> Text(text = "The message text is empty.")
textLength > 100 -> Text(text = "The message text is too long.")
else -> Text(text = "Message sent!")
}
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.