Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i display a progress bar for CardScrollView in Google Glass?

So I've got my little beginning of an app loading data from json into a CardScrollView. Sometimes this takes a few seconds, so I need a loading screen. Normally I'd do this with the progress action bar or a progress bar spinning around. I found a question around this:

https://stackoverflow.com/questions/20237873/google-glass-gdk-progress-indicator

So far so good, however I can't determine how to construct a layout for my activity so I see the progress loading and then when data load is finished, the card scroll view. What I'm doing now is first I set the loading view in the onCreate:

setContentView(mLoadingView)

Then later once the loader is finished I call:

mCardScrollView.activate()
setContentView(mCardScrollView)

Not only does this feel hackish, but it doesn't handle the case of reloading data. Normally I'd do this in android with a frame layout xml which would have the progress bar and list view in it and then toggle progress bar visibility / progress. But I'm not sure how to do this in glass. Maybe I'm not even following the right "glass paradigm". Any ideas?

like image 702
johnarleyburns Avatar asked Nov 23 '25 17:11

johnarleyburns


1 Answers

Currently in the GDK sneak peek, you'll have to roll your own solution like you've already done. But you can track the feature request for a Glass-style progress here here on our issue tracker.

like image 93
Tony Allevato Avatar answered Nov 25 '25 10:11

Tony Allevato



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!