Can anyone tell me how to implement different colors for individual items of recyclerview? Actually, my recyclerview items are video items and they are assigned types also (classical, pop, etc), and I want to assign colors according to the type.
How do I implement that?
Normally, you set up all the views for a
RecyclerView
item inonBindViewHolder()
function of the adapter. So, have aLinearLayout
(or other layout) for your item, find the layout in theonBindViewHolder()
and usesetBackgroundColor()
on it.