You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1 recyclerView.setHasFixedSize(true), this do improve the profermance, only for the case that all item of view has fixed width and height.
2 recyclerView.setItemViewCacheSize(20);
recyclerView.setDrawingCacheEnabled(true);
recyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
Not sure about this
3 set OnClickListener once in onCreateViewHolder() and call through an interface a listener outside of the Adapter, passing the clicked view. don't create extra objects all the time. Already done
4 by updateing adapter, consider do not collect all items all the time, take advantage of the following methods may help, not tests
adapter.notifyItemRangeInserted(rangeStart, rangeEnd)
adapter.setHasStableIds(true);
adapter.notifyItemRemoved(position);
adapter.notifyItemChanged(position);
adapter.notifyItemInserted(position);
this requires that data which to be served has unique ids.
The text was updated successfully, but these errors were encountered:
1 recyclerView.setHasFixedSize(true), this do improve the profermance, only for the case that all item of view has fixed width and height.
2 recyclerView.setItemViewCacheSize(20);
recyclerView.setDrawingCacheEnabled(true);
recyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
Not sure about this
3 set OnClickListener once in onCreateViewHolder() and call through an interface a listener outside of the Adapter, passing the clicked view. don't create extra objects all the time. Already done
4 by updateing adapter, consider do not collect all items all the time, take advantage of the following methods may help, not tests
adapter.notifyItemRangeInserted(rangeStart, rangeEnd)
adapter.setHasStableIds(true);
adapter.notifyItemRemoved(position);
adapter.notifyItemChanged(position);
adapter.notifyItemInserted(position);
this requires that data which to be served has unique ids.
The text was updated successfully, but these errors were encountered: