QuickReturnListView icon indicating copy to clipboard operation
QuickReturnListView copied to clipboard

ListView rendering the whole set of rows

Open AhmadTK opened this issue 11 years ago • 2 comments

I came to a situation with the QuickReturnListView where I noticed that the ListViewadapter is loading the whole set of rows, for example I have ListView with 21 rows, I have traced getView method on the baseAdapter and I found it's loading the whole 21 rows sequentially where the ListView should only load the visible item.

I have tried to remove "getComputedScrollY" method from "QuickReturnListView" class and the ListViewis no longer loading the whole set.

Thanks.

AhmadTK avatar Apr 14 '13 10:04 AhmadTK

This is working as expected as the computeScrollY literally gets the view from getView and then calculates the height for each view among other things. It should only happen once during onGlobalLayout though.

egfconnor avatar Nov 04 '13 23:11 egfconnor

If you know that all your items have the same height, then you should change the computeScrollY() method and only measure the height of one of them (before the for loop) and inside the for just add the calculated height to all items. It improves the performance drastically. Be careful if you have a header or footer.

robertogds avatar Feb 04 '14 16:02 robertogds