mirror of https://github.com/espruino/BangleApps
Notify Hide callback to redraw clock
parent
627dee86bf
commit
452c27b1be
|
@ -208,3 +208,5 @@ setWatch(Bangle.showLauncher, BTN2, false);
|
|||
|
||||
// Handle redraw on LCD on
|
||||
Bangle.on('lcdPower', (on) => { if(on) redraw(); });
|
||||
// Handle redraw on Dismissed Notifications
|
||||
Bangle.on('notifyHide', () => { redraw(); } );
|
||||
|
|
|
@ -156,7 +156,10 @@ exports.hide = function(options) {
|
|||
Bangle.removeListener("touch", exports.hide);
|
||||
function anim() {
|
||||
pos += 4;
|
||||
if (pos > 0) pos = 0;
|
||||
if (pos > 0){
|
||||
pos = 0;
|
||||
Bangle.emit('notifyHide');
|
||||
}
|
||||
Bangle.setLCDOffset(pos);
|
||||
if (pos < 0) setTimeout(anim, 10);
|
||||
}
|
||||
|
|
|
@ -126,4 +126,5 @@ exports.hide = function(options) {
|
|||
global["\xff"].watches[Bangle.btnWatches[0]].callback();
|
||||
global["\xff"].watches[Bangle.btnWatches[1]].callback();
|
||||
}
|
||||
Bangle.emit('notifyHide');
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue