"Lazy loading" for TableView widget

@CoronaLabs

  1. Add a new event to the scroll listener when a tableView has stopped scrolling.

  2. Expose the velocity attribute of the tableView to determine if a tableView is currently in motion.

This is necessary when lazy loading images in the tableView’s rows. Without lazy loading, scroll performance can become very choppy.

With these new features it would be possible to easily implement lazy loading.

Feature request:
http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/6315443-scroll-stopped-event-for-tableview-widget

It’s possible to hack this at the moment by accessing undocumented attributes of the tableView, however an official solution is always the best  ;).

This is similar to what I’m using to achieve this functionality

local prevSpeed = 0 local currentSpeed local inMotion = false local function onStop()    print ("Table Has Stopped") end local checkTableMotion (event)     currentSpeed = tableView.\_view.\_velocity     if ( currentSpeed == 0 or currentSpeed == prevSpeed) then          if ( inMotion == true ) then              onStop()              inMotion = false          end     else          inMotion = true     end     prevSpeed = currentSpeed end Runtime:addEventListener ("enterFrame", checkTableMotion)

That’s pretty much what I’m doing as well.

I’ve come across another needed tableview function, and that is to render a specific row in the table. When downloading thumbnails to be displayed in tableView rows they can arrive in any order and at varying times. Calling tableView.reloadData() every time a thumbnail becomes available is overkill, and performance hogging.

Again, it’s possible to hack around this, but exposing a row rendering function would be appreciated.

This is similar to what I’m using to achieve this functionality

local prevSpeed = 0 local currentSpeed local inMotion = false local function onStop()    print ("Table Has Stopped") end local checkTableMotion (event)     currentSpeed = tableView.\_view.\_velocity     if ( currentSpeed == 0 or currentSpeed == prevSpeed) then          if ( inMotion == true ) then              onStop()              inMotion = false          end     else          inMotion = true     end     prevSpeed = currentSpeed end Runtime:addEventListener ("enterFrame", checkTableMotion)

That’s pretty much what I’m doing as well.

I’ve come across another needed tableview function, and that is to render a specific row in the table. When downloading thumbnails to be displayed in tableView rows they can arrive in any order and at varying times. Calling tableView.reloadData() every time a thumbnail becomes available is overkill, and performance hogging.

Again, it’s possible to hack around this, but exposing a row rendering function would be appreciated.