What I want to achieve is the following, that an element is painted in one color and the next in another:
-----------
item0: azul
-----------
item1: amarillo
-----------
item2: azul
-----------
item3: amarillo
-----------
...
and thus without end, that is to say, to use two different colors and that each item is having the color that does not have the one of above.
At the moment what I have achieved is to assign it myself, but one by one ..
@Override
public void onBindViewHolder(RecordatoriosViewHolder holder, int position) {
final Recordatorios singleRecordatorios = listRecordatorioses.get(position);
if(position==1)
holder.cardview_item.setBackgroundColor(Color.BLUE);
else if(position==2)
holder.cardview_item.setBackgroundColor(Color.YELLOW);