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

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -