android - Comparing items in onBindViewHolder -


i have list , when item premium , not purchased yet, i'll apply filter in imageview.

the problem is, works when start app, when start scroll, other itens starts gray filter well. , filter on everyline line.

@override     public void onbindviewholder(themeviewholder holder, int position) {         tema t = temalist.get(position);         boolean comprado = bp.ispurchased(t.getskutema());         holder.tematexto.settext(t.getnometema());         holder.temaicone.setimageresource(t.geticonetema());         if(t.getispremium() != 0){             log.d("adapter", "posição: "+ position + " premium: " + t.getispremium());             colormatrix matrix = new colormatrix();             matrix.setsaturation(0);             colormatrixcolorfilter filter = new colormatrixcolorfilter(matrix);             holder.temaicone.setcolorfilter(filter);         }     } 

only position < 6 result in "ispremium = 0", , have 10 items.

my log

01-24 14:22:45.048 17282-17282/llamaze.com.br.whattodraw d/adapter: posição: 7 premium: 1 01-24 14:22:45.071 17282-17282/llamaze.com.br.whattodraw d/adapter: posição: 8 premium: 1 01-24 14:22:45.117 17282-17282/llamaze.com.br.whattodraw d/adapter: posição: 9 premium: 1 

am doing someting wrong?

a recyclerview called because recycles views.

that said, when scrolling premium views reused non-premium rows well.

all need implement else branch if statement remove filter, if non-premium.


Comments