luizgrp / SectionedRecyclerViewAdapter

An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.
MIT License
1.68k stars 372 forks source link

Same type of sections are causing to "hold" the same views multiple times (scrolling lag/stutter). #92

Closed zlluvhaj closed 6 years ago

zlluvhaj commented 6 years ago

I'm not sure if there is any hope for help in this project, but still. When I scroll for the first time to the bottom, it's laggy/stuttering. I have added some debug lines and I noticed that the getItemViewHolder gets called for each section class which leads to unnecessary findViewById calls and causing the lag possibly (also, the findViewById debugs are only showing up for the first scroll-down)? I have cut down my whole layout and the lag was still there (except when I only had TextView left). It's not confirmed 100%, so any ideas/suggestions are welcome. Basically my sections are built up like this, just in a mobile-friendly manner: https://i.imgur.com/yZOFFfv.png

yccheok commented 6 years ago

Hi @zlluvhaj , if you can have a mini sample project code, to demonstrate your mentioned problem, it will be great.

luizgrp commented 6 years ago

Hi @zlluvhaj,

Please check issue #10, in that case there was a custom view in the layout causing the scroll lag. Seems to be similar to your problem.

Can't help much without seeing any code of your section and layouts.

You should open a question in stackoverflow.com in order to get faster answers from different people.