-
• #2
Is there a better way?
Not really, and you probably need to
load()
the clock anyway after you're done, because it needs to fully redraw itself.
The launcher only shows<appid>.app.js
files, so you can just add e.g.<appid>.showAlert.js
andload(<appid>.showAlert.js)
. -
• #3
There is an actual 'notification' app/library that handles this: https://github.com/espruino/BangleApps/tree/master/apps/notify
On Bangle.js 1 it can use the in-LCD buffer to scroll the screen and display the notification, but on Bangle.js 2 the only option is basically what you're doing - display and then reload after (done by
notifyfs
).Using
require("notify")
is best though , as hopefully it some point the situation will improve, and when it does we can just update the library.
What's the proper way of showing a pop-up notification from a widget?
So far I updated widbt_notify to use the following code:
The problem I get is that if the watchface calls its
draw()
function while popup is still visible, the popup screen is (partially) overwritten.I checked other widgets:
But it seems there's no other examples.
One solution would be to complement a widget with a tiny app, which is launched only to show a popup. Sounds like an overkill. Is there a better way? If not, is there a way to ship a widget with an app, while hiding the app from the launcher?