Skip to content
Permalink
Browse files

Fix bug in PokemonColorUtil

  • Loading branch information
zsmb13 committed Jan 7, 2020
1 parent 0f4d3ff commit 2bc8d9a02f5ac3a21922774242a4b7edff728e03
Showing with 2 additions and 1 deletion.
  1. +2 −1 app/src/main/java/dev/marcosfarias/pokedex/utils/PokemonColorUtil.kt
@@ -8,6 +8,7 @@ import dev.marcosfarias.pokedex.R

class PokemonColorUtil(var context: Context) {

@ColorInt
fun getPokemonColor(typeOfPokemon: List<String>?): Int {
val type = typeOfPokemon?.elementAtOrNull(0)
val color = when (type?.toLowerCase()) {
@@ -18,7 +19,7 @@ class PokemonColorUtil(var context: Context) {
"poison", "ghost" -> R.color.lightPurple
"ground", "rock" -> R.color.lightBrown
"dark" -> R.color.black
else -> return R.color.lightBlue
else -> R.color.lightBlue
}
return convertColor(color)
}

0 comments on commit 2bc8d9a

Please sign in to comment.
You can’t perform that action at this time.