<Set different background colors for cardView in o...
# stackoverflow
u
Set different background colors for cardView in order of odd and even Want to set different background colors for odd and even cardview for recyclerview. Trying in onBindViewHolder method of Adapter class. class NotificationAdapter(private val notifications: List) : RecyclerView.Adapter() { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NotificationViewHolder { val inflater = LayoutInflater.from(parent.context) val view = inflater.inflate(R.layout.card_notification, parent, false) return NotificationViewHolder(view) } override...