appcelerator/titanium_mobile — pull request #2515 by farfromrefug (2012-07-06 13:26:19+00:00)
Title: Tableview improvements

The first thing and most important thing in that branch is an optimisation of scrolling on android. the getView() method is called many times on the same row, and every-time the setRowData was called (which is really heavy).
So i changed it to only call setRowData when the data actually changed.

I also added "reuse" and "rowappear" events in the tableview. This allows huge improvements in tableview loading and scrolling. For exemple if you download async images, you can start the download only when the row appears and stop it on reuse. Also you can "create" the row content only on "rowappear".
When you have a lot of complex rows it can drastically improve table loading. So the idea is that you create the rowData only with empty rows. Then on "rowappear" you create your custom view and add it to the row.
It works amazingly well. I still have to figure out why on android when loading the tableview, displayed cells first appear empty then fill themselves.
I add to fire the "reuse" event on the row itself, because of the ios implementation.
The "rowappear" event is fired on the tableview

I am willing to improve anything necessary to make this go through. But i think it can help people a lot! especially with tableviews.