Notification bar across top of Vivoactive

Former Member
Former Member
I am wanting to replicate the notification bar that is displayed when the vivoactive is looking for GPS signal. It goes across the top of the screen. Do you have to make your own View from scratch to achieve these notification messages across the top of the screen? or is there something in the API you can use?

Looking at the User Experience Guide it says ..

"If the notification is less pertinent to the activity (weak GPS signal), you can present a one line toast to the user. This toast will tie up a small portion of the screen for a limited period of time, and then time out."

So assuming I need to make one myself, does anyone know what the dimensions of this are so that I can make it look the same as the ones that are currently displayed on the vivoactive screen? I also assume I use popView and pushView to do this? I did go looking for an example, but could not really find what I am after.

thank you in advance for any ideas.
  • I don't believe that there is anything in the current ConnectIQ API that supports the concept of a 'toast' as described. This might be something that is planned, I don't know.

    If you decide to implement it, I don't know that I'd implement it using a class derived from Ui.View. My reasoning is that you would typically use pushView() to push a view to the top of the view stack. When you do this, it takes focus away from the view that is running, preventing it from automatically updating while the other view is being shown. You could work around this by having your ToastView take a pointer to the view that spawned it and then have your ToastView call onUpdate() on the parent view before drawing itself.

    Another option would be to make a type derived from Ui.Drawable that did all of the dirty work of rendering the toasts (a toaster). It would maintain an array of toasts to display, and would render them as a stack with the oldest at the bottom. It would manage the lifetime for individual toasts, and would need logic for what to do if a toast is added when others are displayed, and for when a toast is removed while others are coming in. When a new toast is added, it would trigger an animation to draw the toast list dropping in from the top of screen (possibly using Ui.animate()), it would sit for a second, and then would another animation would trigger to draw it retracting up. Every View in my application would get a reference to this toaster, and would call draw on it after drawing itself.
  • Former Member
    Former Member over 10 years ago
    Thank you for that. I think what I might do is just have the "toasts" as part of the main view then and just draw the main screen, if there is a message that I need to display I would just draw it at the end. Basically, just want to achieve a similar look to when the vivoactive is waiting for GPS signal at the start, it draws a toast across the top and flashes the word GPS on and off. Then once found, displays a screen with arrow to select START to begin.

    Will see how I go, thank you!
  • Toasts are something that we have planned, but they aren't available yet. So, what you're seeing in the user experience guide is a little peek into the future. Apologies if our docs were misleading or caused you confusion.
  • Former Member
    Former Member over 10 years ago
    Toasts are something that we have planned, but they aren't available yet. So, what you're seeing in the user experience guide is a little peek into the future. Apologies if our docs were misleading or caused you confusion.


    No worries, I just simulated one by drawing it last on the screen and setting height to 20 with a line across the bottom. Looks pretty much identical so its all good. I am just trying to copy the look and feel of the current apps as much as possible. I am only really experimenting at the moment to see what can be done. I am slowly beginning to understand :)