ScrollView scroll down to refresh content

Hi all,

I’m having trouble in customizing new ScrollView in following case:

I want my scrollview reload new content when dragging down a distance. While loading new data the scrollview have to stop bouncing back to top y = 0 (it should bounce back to y = 50px), then user can see the loading icon progress there. After new content loaded, the scrollview bounce to y = 0 to hide the loading icon.

Can any one give me a clue to do this in Corona? Now I’m using widget.newScrollView, is there any way to let the scrollview stop at y=50px when bouncing back to wait for new data loading, and then bounce back to y = 0 when data loading is completed.

Thank you,

See the following Code Exchange sharing by Horacebury. It uses widget 1 library but it works great nevertheless. 

http://developer.coronalabs.com/code/improved-widgetdemo-sample

Hi ksan,

I couldn’t find my need in the topic, can you show me the exact post?

I also can’t run the Improved WidgetDemo due to some errors in the sample code.

Thanks

Any other suggestion?

Sorry for missing your earlier question. The code works. You need to get the widgets 1.0 version and put it in the project folder. Code is a little complicated and hard to follow but it works and is a joy to see it in action. Hope this helps. 

No solution for this?

It’s more than 2 weeks, but no one can suggest me a solution? Corona can’t do this?

Corona can do this. You need to program it to do it. For example, to respond to your specific question… 

is there any way to let the scrollview stop at y=50px when bouncing back to wait for new data loading, and then bounce back to y = 0 when data loading is completed.,

scrollView:scrollToPosition({y=50, time=0}) and 

scrollView:scrollToPosition({y=0, time=0}) 

will get you the desired scrollView behaviour.

The enhanced widgetDemo link I mentioned a few posts above has the pull to refresh nicely implemented. Best to go over it and try to make it work.

Hope this helps. 

See the following Code Exchange sharing by Horacebury. It uses widget 1 library but it works great nevertheless. 

http://developer.coronalabs.com/code/improved-widgetdemo-sample

Hi ksan,

I couldn’t find my need in the topic, can you show me the exact post?

I also can’t run the Improved WidgetDemo due to some errors in the sample code.

Thanks

Any other suggestion?

Sorry for missing your earlier question. The code works. You need to get the widgets 1.0 version and put it in the project folder. Code is a little complicated and hard to follow but it works and is a joy to see it in action. Hope this helps. 

No solution for this?

It’s more than 2 weeks, but no one can suggest me a solution? Corona can’t do this?

Corona can do this. You need to program it to do it. For example, to respond to your specific question… 

is there any way to let the scrollview stop at y=50px when bouncing back to wait for new data loading, and then bounce back to y = 0 when data loading is completed.,

scrollView:scrollToPosition({y=50, time=0}) and 

scrollView:scrollToPosition({y=0, time=0}) 

will get you the desired scrollView behaviour.

The enhanced widgetDemo link I mentioned a few posts above has the pull to refresh nicely implemented. Best to go over it and try to make it work.

Hope this helps.