0

I am working on project which has a complex recyclerview .its similar to instagram post feed. i use mikepenz/FastAdapter for recyclerview adapter, which has pretty smooth scrolling. but when i starts to append the news items to the adapter the scrolling starts stutter.

i profiled the apps memory usage and its get higher when we load more items.

so what is best way to avoid this memory jumping. i tried all the docs and still they all appends items to adapter and it works.in my case this makes ui clunky

inval
  • 380
  • 1
  • 4
  • 11
  • Do you use library for showing your images? Like Picasso or Glide? – Saber Solooki Jun 12 '18 at 17:35
  • Also I recommend that implement your own recycler adapter and don't use library for that. – Saber Solooki Jun 12 '18 at 17:38
  • I don’t see the advantage of the library you’re using. Implementing the RecyclerView pattern is a pita, but these days, it takes sub 15 minutes to get a simple list ready to customize and with well separation of concerns. more than 1/2 of the recycler view properties you may not care, can be declared in XML (Including the LayoutManager if you don’t care for custom!)… get Glide,Picasso or similar to download and manager you in-memory cache of images and ensure you don’t instantiate needless things in your Bind View or CreateViewHolder callbacks. pre-instantiate things. – Martin Marconcini Jun 12 '18 at 17:53
  • Oh… and show some code… I don’t know what you’re asking here. – Martin Marconcini Jun 12 '18 at 17:53
  • yes i do. i use Glide for image loading with caching – inval Jun 12 '18 at 17:59
  • @MartinMarconcini its relatively same code as the example show in the lib, https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/EndlessScrollListActivity.java – inval Jun 12 '18 at 18:01
  • i don't have any performance issue for about 30+ items but after that its starts to stutter – inval Jun 12 '18 at 18:04
  • Did you try the Profiler to evaluate if memory is going up and what the allocations are? Does this happen if you always load the same small image? (pick one, hardcode its URL and always load the same one). Start isolating things – Martin Marconcini Jun 13 '18 at 17:29
  • 1
    hey i found the issue .its happening because of nestedScrollView. recyclerview won't recycle views if it is inside a nestedScroll. – inval Jun 13 '18 at 18:16

0 Answers0