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:
// NRF.on('disconnect',
var tId = setTimeout(load, 3000);
E.showAlert(/*LANG*/'Connection\nlost.', 'BLUETOOH').then(()=>{
// ok clicked before timeout
clearTimeout(tId);
load();
});
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:
$ grep showAlert wid*/widget.js
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?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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?