From d76c82a862162c576f7eb16bb512962814d646f9 Mon Sep 17 00:00:00 2001 From: the-dagger Date: Sat, 4 Aug 2018 00:54:11 +0530 Subject: [PATCH] fix : convert the names to uppercase --- app/src/main/java/app/harshit/pokdex/PokemonAdapter.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/harshit/pokdex/PokemonAdapter.kt b/app/src/main/java/app/harshit/pokdex/PokemonAdapter.kt index 8344ca4..249cea9 100644 --- a/app/src/main/java/app/harshit/pokdex/PokemonAdapter.kt +++ b/app/src/main/java/app/harshit/pokdex/PokemonAdapter.kt @@ -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 @@ -22,6 +23,7 @@ class PokemonAdapter(private val pokeList: List) : RecyclerView.Adapter override fun getItemCount() = pokeList.size + @SuppressLint("SetTextI18n") override fun onBindViewHolder(holder: PokeHolder, position: Int) { val currentItem = pokeList[position] @@ -31,7 +33,7 @@ class PokemonAdapter(private val pokeList: List) : 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()}%" }