Get immediate access to this and over 1,500+ other videos and books.

Boost your skills with a raywenderlich.com Beginner subscription. With over 60+ video courses and our core foundational programming books bundled in one subscription, it’s simply the best investment you can make in your development career.

Improve the Alert Title

This video was last updated on Jul 14 2022

Use conditional statements to display different messages on the alert dialog based on the player’s performance.

Contributors

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.

Okay, this is not a challenge episode. I didn’t mean what I said earlier.

private fun alertTitle(): String {
    
}
val difference = abs(targetValue - sliderValue)
val title: String = if (difference == 0) {
    getString(R.string.alert_title_1)
} else if (difference < 5) {
    getString(R.string.alert_title_2)
} else if (difference <= 10) {
    getString(R.string.alert_title_3)
} else {
    getString(R.string.alert_title_4)
}
...
return title
val dialogTitle = alertTitle()
private fun differenceAmount() = abs(targetValue - sliderValue)

Reviews

Comments