add gradient drawable and colors to card view android

  • Thread starter Thread starter Android Central Question
  • Start date Start date
A

Android Central Question

I am using view recycling in my application. There are 13 items in my list view. Each list item has a card view. I want the fourth(index 3) list item's card view to have the drawable background and all the remaining list item's card view to have the different colors that are defined in color.xml file.

I am not sure how to implement this functionality. Please help.
 
I moved this to the Software Development forum for more specific traffic.