I'm building a mobile app. In the app, I am calling an api to fetch top 20 photos (api only allows 20 at a time) and displaying it in a tiled 2 column list/grid. When the user reaches the 10th/last row I'd like call the api again and bring up the next 20 images and so on so it seems like it's a continuous scroll.
Is there some kind of a end of list event that can be used for this or is there some other method to get this done?
Also, it would be great if I can invoke the api when the user is around the 5th row or 15th row and so on so that the images show up before the user reaches the end of the list.
You can detect when the scrollbar is scrolled:
To set the scroll position:
Please vote for this enhancement: http://bugs.adobe.com/jira/browse/SDK-30049
Note that loading a bunch of images during a throw scroll operation may lead to poor scrolling framerate depending on how you implement it. See the logic in IconItemRenderer for an example of how to cache and queue images.