android - RecyclerView parameters stick around after re-drawing the list -
so, i've got recyclerview
textviews on cards. 1 of these can turn red&bold, based on parameters, using holder.devicetv.settextcolor(color.red);
& holder.devicetv.settypeface(null, typeface.bold);
works fine, can see in image below, above black bar.
later, remove cards red&bold textview, , notify adapter. results in see below black bar in image, should not case. i'm guessing because (duh) recyclerview
, parameters set on before, have stayed around. don't know why chooses use cards red&bold text, does, every time.
what best way fix issue?
you need call holder.devicetv.settextcolor(color.black)
, holder.devicetv.settypeface(null);
in onbindviewholder method make sure displayed want.
there might small overhead it's faster creating new view scratch.
Comments
Post a Comment