Skip to content

Instantly share code, notes, and snippets.

@Nublo
Created July 23, 2019 10:00
Show Gist options
  • Save Nublo/52edda268e26ada7ca36e907655fa431 to your computer and use it in GitHub Desktop.
Save Nublo/52edda268e26ada7ca36e907655fa431 to your computer and use it in GitHub Desktop.
fun getBackground(goal: GoalInProgress) =
when (goal.progress) {
in 0.0..0.5 -> R.drawable.ic_not_filled
in 0.5..0.99 -> R.drawable.ic_half_filled
else -> R.drawable.ic_full_filled
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment