Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
joelajean
Posts: 132
Registered: ‎01-25-2010
My Device: Z30, Z10, Q10, Dev Alpha B & Bold 9900

Re: Pull to Refresh example on GitHub

Perfect... from my side if I find something, I'll keep you posted !!!!

I found it very simple to implement, basically copied your code and first take it worked without any glitch... heeeu, I just had to change the font color and the refresh image color coze first run nothing appeared in the top banner coze my bkg is white :smileyhappy:

 

Thanks for sharing !!!

 

Please use plain text.
Developer
rnickel
Posts: 62
Registered: ‎10-29-2008
My Device: 9800

Re: Pull to Refresh example on GitHub

So I went ahead and updated the project to make implementing pull to refresh in your own projects even simpler.

 

I even wrote up a short blog post on how some of the pieces work. http://www.ryannickel.com/2013/02/super-quick-rundown-of-pull-to-refresh-for-blackberry-10-cascades/

 

 

... I'm not a writer so if anyone wants to write a better post please feel free :smileyhappy: haha

Please use plain text.
Trusted Contributor
AllSystemGo
Posts: 140
Registered: ‎11-23-2010
My Device: Torch 9800

Re: Pull to Refresh example on GitHub

Thank you for the tutorial. It's really great to see this nice community helping each other.
Please use plain text.
Contributor
CrystalBullet
Posts: 19
Registered: ‎02-14-2013
My Device: Red Z10

Re: Pull to Refresh example on GitHub

Great post and I like the interface of the control.

 

I made a fork with some improvments:

  • Moved list item component definition out of the reusable PullToRefreshListView component
  • Made the refresh icon rotate as we pull
  • Reduced size of progress indicator
  • Localization ready
  • Updated to allow refreshing by other means than pull to refresh

It is available here: https://github.com/Larochelle/bb10pulltorefresh

--
Martin Larochelle
Macadamian
http://bb10ize.me
Please use plain text.
Developer
rnickel
Posts: 62
Registered: ‎10-29-2008
My Device: 9800

Re: Pull to Refresh example on GitHub

Very handy updates!

 

If you send a pull request in github I can merge your changes with my master branch.

Please use plain text.
Developer
nhuanvd
Posts: 20
Registered: ‎12-11-2012
My Device: Blackberry Z10

Re: Pull to Refresh example on GitHub

One more Pull to Refresh project by Xitij Ritesh Patel.

Read more at: http://www.xitijpatel.com/2013/01/20/how-to-implement-pull-to-refresh-in-blackberry-10-cascades

Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C

Re: Pull to Refresh example on GitHub

The samples work very well but if i need this to work with data model - RSS Feed what are the main changes.

 

I notice the code is based on twitter feed is this also similar to the data model feed.

 

Any help would be great thanks

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Contributor
CrystalBullet
Posts: 19
Registered: ‎02-14-2013
My Device: Red Z10

Re: Pull to Refresh example on GitHub

Assuming that you expose your RSS data using a C++ object as:

Q_PROPERTY(bb::cascades::smileyvery-happy:ataModel* myDataModel READ myDataModel CONSTANT)

Your C++ code just needs to fill a ArrayDataModel or GroupDataModel and emit a signal when new data is loaded.

In QML you connect the dataModel to the list:
PullToRefreshListView {
id: myList
dataModel: _datasource.myDataModel
}

Can connect the signal to be notified when the user pulls to refresh:
mylist.refreshTriggered.connect(onRefreshTriggered);

And when the event is triggered, you ask your C++ class to fetch new data:
function onRefreshTriggered() {
myList.loading = true;
_datasource.fetchData();
}

When it is done, make it emit a signal so your QML can stop the activity indication:
function onDataLoaded() {
myList.loading = false;
}
--
Martin Larochelle
Macadamian
http://bb10ize.me
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C

Re: Pull to Refresh example on GitHub

Thanks I try this out
BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Contributor
jhitchcock
Posts: 14
Registered: ‎06-01-2011
My Device: BlackBerry Q10

Re: Pull to Refresh example on GitHub

Sorry to reply to an old thread, however it is relevant to this. 

 

Did anyone ever get anything working with scrollview. I have tried a few ideas but it didnt work out. Its a shame scrollview doesnt have leadingVisual. 

Please use plain text.