Skip to content

Commit

Permalink
fix : convert the names to uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithdwivedi committed Aug 3, 2018
1 parent d55e44d commit d76c82a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/src/main/java/app/harshit/pokdex/PokemonAdapter.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package app.harshit.pokdex

import android.annotation.SuppressLint
import android.content.Context
import android.support.v4.content.ContextCompat
import android.support.v7.widget.RecyclerView
Expand All @@ -22,6 +23,7 @@ class PokemonAdapter(private val pokeList: List<Pokemon>) : RecyclerView.Adapter

override fun getItemCount() = pokeList.size

@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: PokeHolder, position: Int) {

val currentItem = pokeList[position]
Expand All @@ -31,7 +33,7 @@ class PokemonAdapter(private val pokeList: List<Pokemon>) : RecyclerView.Adapter
currentItem.accuracy < .30 -> holder.itemView.itemAccuracy.setTextColor(ContextCompat.getColor(context, R.color.red))
else -> holder.itemView.itemAccuracy.setTextColor(ContextCompat.getColor(context, R.color.orange))
}
holder.itemView.itemName.text = currentItem.name
holder.itemView.itemName.text = "${currentItem.name[0].toUpperCase()}${currentItem.name.substring(1)}"
holder.itemView.itemAccuracy.text = "Probability : ${(currentItem.accuracy * 100).toInt()}%"
}

Expand Down

0 comments on commit d76c82a

Please sign in to comment.