#RecyclerView #Performance #Scrolling #DiffUtil #10Tips #Android #Tamil
This video will help you to understand the way of improving the scrolling performance in recycler view. Here, we discussed the top 10 tips for the same.
Tip 1: ListView Item layout design (Flat layout instead of nested one) Use ConstraintLayout
Tip 2: Minimum number of inflates or too may View Types
Tip 3: Simple onBindViewHolder () - Only data binding. No Object creation or click events
Tip 4: NO - notifyDataSetChanged ()
adapter.notifyItemRangeInserted(rangeStart, rangeEnd);
adapter.notifyItemRemoved(position);
adapter.notifyItemChanged(position);
adapter.notifyItemInserted(position);
Tip 5: If notifyDataSetChanged() is necessary, please use Useadapter.setHasStableIds(true)
Tip 6: Use DiffUtil callback
Tip 7: Consider caching & compression mechanism for images, if used.
Use Glide, Picasso library
Tip: 8Make your recycler view height is fixed- recyclerView.setHasFixedSize(true)
Tip 9: recyclerView.setItemViewCacheSize(cacheSize)
Tip 10: SetRecycledViewPool - For nested Recycler View
Reference: https://blog.mindorks.com/recyclervie...
https://developer.android.com/topic/p...
/ easily-adding-nested-recycler-view-in-android