list scrolling listener

Hi guys,

I’m wondering what’s the best way to know when the list of a table view has started / stopped scrolling.

What I’m trying to do is that if a user has has stopped scrolling the list, the list will reposition itself to a certain scrollToY() position.

thanks in advance.
[import]uid: 74667 topic_id: 33894 reply_id: 333894[/import]

Don’t know of any particular event or call for that.

But there may still be ways to get to point B. If you have an enterFrame listener, you could possibly compare the value of two successive tableView.getContentPosition() calls (from 2 sequential enterFrame events), and if the values are the same - the list didn’t scroll between frames, and you could perform your algorithm… (if the contentPosition values are different, the list has scrolled between enterFrame events, so wait it out).

Basically potsifera, if someone doesn’t pipe up with a solution, you could try and determine it manually. [import]uid: 79933 topic_id: 33894 reply_id: 134751[/import]

Actually that information is available.

widget.newTableView and widget.newScrollView support a listener function that will handle events generated from scrolling the events. The newTableview docs lists the events generated by the widget, but the example is in the widget.newScrollView docs:

http://docs.coronalabs.com/api/library/widget/newTableView.html
http://docs.coronalabs.com/api/library/widget/newScrollView.html

The tableView generates the following events: “beganScroll”, “endedScroll”, “movingToTopLimit”, “movingToBottomLimit”. “beganScroll” and “endedScroll” are pretty obvious. I think you get “movingToTopLimit” when someone has pulled down on the list to a point that the top row is lower than the top of the view and when they release it and it springs back into place, this get generated. I presume “movingToBottomLimit” is the opposite when someone is at the bottom of the list and they pull up and it springs back down.

This wasn’t working for tableViews until a build around the 950’s if I remember correctly. So you def. want the latest daily or the most recent public build to make sure this works. [import]uid: 199310 topic_id: 33894 reply_id: 134812[/import]

Thanks for your explanation of movingToTopLimit and movingToBottomLimit Rob, it helped me understand what those events were. I never knew what they were and I can really take advantage of them in my current project. [import]uid: 58885 topic_id: 33894 reply_id: 134825[/import]

Thanks for pointing the example & the new documentation Rob. It was just what I needed :slight_smile: [import]uid: 74667 topic_id: 33894 reply_id: 134848[/import]

Don’t know of any particular event or call for that.

But there may still be ways to get to point B. If you have an enterFrame listener, you could possibly compare the value of two successive tableView.getContentPosition() calls (from 2 sequential enterFrame events), and if the values are the same - the list didn’t scroll between frames, and you could perform your algorithm… (if the contentPosition values are different, the list has scrolled between enterFrame events, so wait it out).

Basically potsifera, if someone doesn’t pipe up with a solution, you could try and determine it manually. [import]uid: 79933 topic_id: 33894 reply_id: 134751[/import]

Actually that information is available.

widget.newTableView and widget.newScrollView support a listener function that will handle events generated from scrolling the events. The newTableview docs lists the events generated by the widget, but the example is in the widget.newScrollView docs:

http://docs.coronalabs.com/api/library/widget/newTableView.html
http://docs.coronalabs.com/api/library/widget/newScrollView.html

The tableView generates the following events: “beganScroll”, “endedScroll”, “movingToTopLimit”, “movingToBottomLimit”. “beganScroll” and “endedScroll” are pretty obvious. I think you get “movingToTopLimit” when someone has pulled down on the list to a point that the top row is lower than the top of the view and when they release it and it springs back into place, this get generated. I presume “movingToBottomLimit” is the opposite when someone is at the bottom of the list and they pull up and it springs back down.

This wasn’t working for tableViews until a build around the 950’s if I remember correctly. So you def. want the latest daily or the most recent public build to make sure this works. [import]uid: 199310 topic_id: 33894 reply_id: 134812[/import]

Thanks for your explanation of movingToTopLimit and movingToBottomLimit Rob, it helped me understand what those events were. I never knew what they were and I can really take advantage of them in my current project. [import]uid: 58885 topic_id: 33894 reply_id: 134825[/import]

Thanks for pointing the example & the new documentation Rob. It was just what I needed :slight_smile: [import]uid: 74667 topic_id: 33894 reply_id: 134848[/import]