<Kotlin Recyclerview change item color onClick> i ...
# stackoverflow
u
Kotlin Recyclerview change item color onClick i have a Recyclerview adapter in Kotlin and when i click it change the color to Red but if i click another item, the previous item still have the Red color. How to make the logic when the item click it will change Red and when click another item it will back to default color and new item become Red. this is the adapter class CategoryAdapter(private val onClick: OnClickListener): RecyclerView.Adapter() { private val diffCallBack = object: DiffUtil.ItemCallback(){ override fun...