Notify Hide callback to redraw clock

pull/774/head
peeweek 2021-07-23 15:52:51 +02:00
parent 627dee86bf
commit 452c27b1be
3 changed files with 7 additions and 1 deletions

View File

@ -208,3 +208,5 @@ setWatch(Bangle.showLauncher, BTN2, false);
// Handle redraw on LCD on // Handle redraw on LCD on
Bangle.on('lcdPower', (on) => { if(on) redraw(); }); Bangle.on('lcdPower', (on) => { if(on) redraw(); });
// Handle redraw on Dismissed Notifications
Bangle.on('notifyHide', () => { redraw(); } );

View File

@ -156,7 +156,10 @@ exports.hide = function(options) {
Bangle.removeListener("touch", exports.hide); Bangle.removeListener("touch", exports.hide);
function anim() { function anim() {
pos += 4; pos += 4;
if (pos > 0) pos = 0; if (pos > 0){
pos = 0;
Bangle.emit('notifyHide');
}
Bangle.setLCDOffset(pos); Bangle.setLCDOffset(pos);
if (pos < 0) setTimeout(anim, 10); if (pos < 0) setTimeout(anim, 10);
} }

View File

@ -126,4 +126,5 @@ exports.hide = function(options) {
global["\xff"].watches[Bangle.btnWatches[0]].callback(); global["\xff"].watches[Bangle.btnWatches[0]].callback();
global["\xff"].watches[Bangle.btnWatches[1]].callback(); global["\xff"].watches[Bangle.btnWatches[1]].callback();
} }
Bangle.emit('notifyHide');
}; };