Table View Breaks then Speeds back up

Hi there!

Im building an app that relies heavily on the tableView widget and i have come across a problem. Then building for the device, scrolling through a tableview slowly causes no problem what so ever.

But when doing it at human speeds, the scrolling slows down, and then speeds back up. It could be the rendering of the off-screen rows but i don’t think thats the problem as it works fine when i keep my finger in the screen. The problem occurs when i do not touch the display but just flick it up or down. 

Does anyone have a solution for this?

I have tried tinkering with the maximum velocity but that didn’t do the job.

 

Best Regards

Jens

Also on an unrelated note, the tableview has a very crude feel. Its a great tool, but the feel of it is very far away from what is achieved with native code. 

I’m not sure that it’s the issue I have in mind but it has been discussed that any kind of linear movement is noticably not very smooth in corona and other engines for that matter. It’s an inherent problem with the syncing of the graphics engine and the graphics hardware at the core. Just doing a simple tansitions of an object across the screen will show you this. Then the graphics engine can make it worse by doing something in it’s code or the garbage collector taking some time and then your own enterFrame listeners and other things make it worse if they take some time. You won’t notice it when dragging with your finger because you can never be so consistent unless you have a very steady hand.

I don’t know if this is your issue. Are you seeing it as just a momentary freeze and then goes on or is it noticably slowing down over many frames and then speeding back up?

Thank you for your reply Primoz,

You make a good point with regards to the fact that this problem is inherent with many 3 party engines. As far as i can see it noticeably slows down over several frames and then speeds back up. It is as if the max-velocity is reached (then is slows down) but the transition is still going on and when the transition slows (to a point below the max-velocity) the tableview acts normally again. 

I was wondering if it would be possible to bridge some native code that handles the table view. As in write a obj-c library that handles the table with data within the corona part of things. 

 

I have not seen this but I can test it once I get home. Are you seeing this with any CL samples that have a table view?

I’ve just tested this and I don’t see the behavior you are describing. When I scroll quickly it starts to scroll at max scroll speed and then the speed decreases linearly. Do you have some sample code that demonstrates this?

I’ve just tried reducing the maxVelocity as that’s what you said you did and I think I saw what you meant, however I don’t think it’s a problem with the scroll speed itself. It’s a consequence of what I mentioned first. When table view is scrolling fast it has to render many rows per update as they are coming in to view and gives it a bit of a stutter. As it slows down it only has to render 3 then 2 and at the end only 1 row every few frames. I think that is what you are seeing. Try reducing the contents of the rows and see if that makes a difference. Hope this helps.

Thanks a lot for your help primoz!

Just got back from town hence the unresponsiveness. I Think you’re right with the rendering of the rows and the amount of row content. The content i have pr how does involve an image and some text objects but only a few KB of size so nothing that should be a problem.

Some people have reported performance issues when adding graphical content to the table rows. I have to admit I will be left disappointed if it turns out that just adding 2 display objects to the table rows will cause it to stutter. 

I haven’t got a chance to test a sample CL using table view yet on the device, but ill let you know when i do. Just to rule out that its not a problem with my devices. Unlikely though. 

With regards to using native code to create the table view, does anyone have any experience with this?

Best Regards 
Jens
 

I’ve noticed this behavior as well. I would describe the sequence this way:

  • I give the table a quick, upward flick

  • The table responds immediately to my touch, scrolling a few rows

  • The table jumps back to its starting position. (Timing-wise, this seems to be at the end of my touch)

  • A fraction of a second later, the motion from my gesture “kicks in” and the table quickly scrolls as normal.

This doesn’t happen every time, but seems to happen more when starting at the top of the table (or it’s just especially visible since I have topPadding set), and happens more in response to a quick flick.

FYI: This fixed it for me:

http://forums.coronalabs.com/topic/45347-widget-fixes/

Thanks primoz!!

Welcome.

Thanks for the link!

I haven’t had a chance to check it yet, but im looking forward to getting home and giving it a shot.

Best Regards
Jens-Christian Finnerup

@jcfinnerup what ben.morrison describes is not the issue you were talking about. You were talking about the issue where any kind of linear motion is choppy. It’s an ongoing issue with linear transitions or scrolling or any kind of liner movement. The problem ben.morrison describes was a bug in scroll view and table view where if you swiped in the opposite direction while it was bouncing back due to scrolling over the top/bottom it would jump back to start when you let go and then continue scrolling from start due to momentum. This is fixed in the link provided. The choppiness is not fixed and I don’t know if it ever will be cause it’s a graphics core problem with frame timing on Android and simulators. It should be ok on iOS cause it is synched with a system frame timer.

@primoz the problem ben is describing fits the problem that i am having as well. It may be that I have not successfully been able to describe my problem but ben’s very accurate (thanks ben!) walkthrough of the problem is exactly what happens for me. As ben said he was having this problem as well. 

Also i don’t think i am encountering the problem that you were describing, at least not enough to notice it, since i do not experience any kind of lack on the simulator, but only on iOS devices. 

Thanks Anyway

J

I’m not sure that it’s the issue I have in mind but it has been discussed that any kind of linear movement is noticably not very smooth in corona and other engines for that matter. It’s an inherent problem with the syncing of the graphics engine and the graphics hardware at the core. Just doing a simple tansitions of an object across the screen will show you this. Then the graphics engine can make it worse by doing something in it’s code or the garbage collector taking some time and then your own enterFrame listeners and other things make it worse if they take some time. You won’t notice it when dragging with your finger because you can never be so consistent unless you have a very steady hand.

I don’t know if this is your issue. Are you seeing it as just a momentary freeze and then goes on or is it noticably slowing down over many frames and then speeding back up?

Thank you for your reply Primoz,

You make a good point with regards to the fact that this problem is inherent with many 3 party engines. As far as i can see it noticeably slows down over several frames and then speeds back up. It is as if the max-velocity is reached (then is slows down) but the transition is still going on and when the transition slows (to a point below the max-velocity) the tableview acts normally again. 

I was wondering if it would be possible to bridge some native code that handles the table view. As in write a obj-c library that handles the table with data within the corona part of things. 

 

I have not seen this but I can test it once I get home. Are you seeing this with any CL samples that have a table view?

I’ve just tested this and I don’t see the behavior you are describing. When I scroll quickly it starts to scroll at max scroll speed and then the speed decreases linearly. Do you have some sample code that demonstrates this?

I’ve just tried reducing the maxVelocity as that’s what you said you did and I think I saw what you meant, however I don’t think it’s a problem with the scroll speed itself. It’s a consequence of what I mentioned first. When table view is scrolling fast it has to render many rows per update as they are coming in to view and gives it a bit of a stutter. As it slows down it only has to render 3 then 2 and at the end only 1 row every few frames. I think that is what you are seeing. Try reducing the contents of the rows and see if that makes a difference. Hope this helps.

Thanks a lot for your help primoz!

Just got back from town hence the unresponsiveness. I Think you’re right with the rendering of the rows and the amount of row content. The content i have pr how does involve an image and some text objects but only a few KB of size so nothing that should be a problem.

Some people have reported performance issues when adding graphical content to the table rows. I have to admit I will be left disappointed if it turns out that just adding 2 display objects to the table rows will cause it to stutter. 

I haven’t got a chance to test a sample CL using table view yet on the device, but ill let you know when i do. Just to rule out that its not a problem with my devices. Unlikely though. 

With regards to using native code to create the table view, does anyone have any experience with this?

Best Regards 
Jens
 

I’ve noticed this behavior as well. I would describe the sequence this way:

  • I give the table a quick, upward flick

  • The table responds immediately to my touch, scrolling a few rows

  • The table jumps back to its starting position. (Timing-wise, this seems to be at the end of my touch)

  • A fraction of a second later, the motion from my gesture “kicks in” and the table quickly scrolls as normal.

This doesn’t happen every time, but seems to happen more when starting at the top of the table (or it’s just especially visible since I have topPadding set), and happens more in response to a quick flick.