Activity indicator during HTTP.get/.post?

68 views
Skip to first unread message

Dan Brooking

unread,
Mar 6, 2013, 8:53:00 PM3/6/13
to bubbl...@googlegroups.com
I'm working on something and using HTTP.post and that's working fine... but I'd like to have something pop up with it's working to indicate that something is happening.  I've been digging around trying to see if this is somehting I can do in Bubblewrap or if it needs to be done outside of Bubblewrap.  

The change log says "Added network activity notification to the HTTP wrapper." for version 0.2.0 so I'm thinking I can do this with Bubblewrap. Just not sure how...

any help would be appreciated

Thanks
Dan

Matt Aimonetti

unread,
Mar 6, 2013, 10:03:08 PM3/6/13
to bubbl...@googlegroups.com
This is done automatically via the network indicator on screen. The code I used to enabled this feature is here: https://github.com/rubymotion/BubbleWrap/blob/master/motion/http.rb#L117

If you want to display something else like a modal, you need to do that in your code. Remember that BubbleWrap HTTP wrap is async so if you use a block to make your request, the block will only be dispatched/executed when the response is coming back. Your code isn't blocked meaning that whatever you have after the block will probably execute first.

I don't use RubyMotion anymore so I don't have any examples handy but basically you could create a modal with a spinner and start it before you trigger the request and when the response comes back, you can remove the modal. Does it make sense?

- Matt


--
You received this message because you are subscribed to the Google Groups "BubbleWrap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bubblewrap+...@googlegroups.com.
To post to this group, send email to bubbl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/bubblewrap/-/ZE0A-0cqUDkJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dan Brooking

unread,
Mar 6, 2013, 10:05:37 PM3/6/13
to bubbl...@googlegroups.com
Perfect... This is exactly what I wanted to know. Thanks!
Reply all
Reply to author
Forward
0 new messages