widget 2.0 issues in tableView

I’ve been porting to widget 2.0, and there are a number of significant issues that I’m working around in my code (rather than forking the open-sourced “real” version, since I want to stick with Corona’s official code).

For example:

  • deleting a row runs a transition. Fancy, but if the user taps something else in the UI while that transition is still running, it can blow up the app; i’ve worked around it by deleting all rows and reinserting all but the deleted one

  • velocity doesn’t always get set to zero when you scroll the list, so a bunch of stuff doesn’t work if the next touch is only supposed to work on a non-moving list; worked around it by forcing the velocity to 0 on certain user touches

  • re-rendering of rows is no longer exposed; worked around by modifying my row rendering code and using this function added to the tableView.

    function tableView:reRenderRow( row )     local event = {         row = row._view,         target = self,     }     self._onRowRender( event ) end

  • the hard-coded 100ms and 110ms behaviors and “timeHeld” functionality in general results in a sluggishness that can’t be worked around

Also, tableView touch and tap events don’t include like content. From the open source code:

Touch event:

{     phase = "cancelled", -- or other phase name     target = event.target,     row = self.\_targetRow, }

tap event (note missing “row” attribute):

{     phase = "tap",     target = row, -- row was earlier set to event.target, so this matches }

Also, tableView touch and tap events don’t include like content. From the open source code:

Touch event:

{     phase = "cancelled", -- or other phase name     target = event.target,     row = self.\_targetRow, }

tap event (note missing “row” attribute):

{     phase = "tap",     target = row, -- row was earlier set to event.target, so this matches }