performance - Items in RecyclerView collapse when scrolling too fast back and forth -


i have app retrieves data database. data displayed in 2 fragments instantiated mainactivity via viewpager. both fragments contain single recyclerview.

printscreen

when scrolling recyclerviews very fast (back , forth) structure of list items collapses.

@override public void onbindviewholder(matchviewholder holder, int position) {     mgames.movetoposition(position);     string hometeam = mgames.getstring(mgames.getcolumnindex(dbcontract.teamentry.alias_home_team));     string awayteam = mgames.getstring(mgames.getcolumnindex(dbcontract.teamentry.alias_away_team));     int homescore = mgames.getint(mgames.getcolumnindex(dbcontract.gameentry.column_home_score));     int awayscore = mgames.getint(mgames.getcolumnindex(dbcontract.gameentry.column_away_score));     string datestring = mgames.getstring(mgames.getcolumnindex(dbcontract.gameentry.column_date));     simpledateformat fromformat = new simpledateformat(dbcontract.sql_date_format, locale.english);      try {         date date = fromformat.parse(datestring);         simpledateformat toformat = new simpledateformat("hh:mm - d mmm yyyy");         datestring = toformat.format(date);     } catch (parseexception e) {         e.printstacktrace();     }      holder.listitemhometeam.settext(hometeam);     holder.listitemhomescore.settext(0 <= homescore ? string.valueof(homescore) : "");     holder.listitemawayteam.settext(awayteam);     holder.listitemawayscore.settext(0 <= awayscore? string.valueof(awayscore) : "");     holder.listitemdate.settext(datestring);     holder.listitemhomelogo.setimageresource(resourceutils.getlogoresource(mgames.getint(mgames.getcolumnindex(dbcontract.teamentry.alias_home_id))));     holder.listitemawaylogo.setimageresource(resourceutils.getlogoresource(mgames.getint(mgames.getcolumnindex(dbcontract.teamentry.alias_away_id)))); } 


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -