From 452c27b1bed832c4ca508ae546860c2fef01c2e4 Mon Sep 17 00:00:00 2001 From: peeweek <4037271+peeweek@users.noreply.github.com> Date: Fri, 23 Jul 2021 15:52:51 +0200 Subject: [PATCH] Notify Hide callback to redraw clock --- apps/hcclock/hcclock.app.js | 2 ++ apps/notify/notify.js | 5 ++++- apps/notifyfs/notify.js | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/hcclock/hcclock.app.js b/apps/hcclock/hcclock.app.js index dac5063cb..d060c4b2f 100644 --- a/apps/hcclock/hcclock.app.js +++ b/apps/hcclock/hcclock.app.js @@ -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(); } ); diff --git a/apps/notify/notify.js b/apps/notify/notify.js index 230cf9d10..89c843246 100644 --- a/apps/notify/notify.js +++ b/apps/notify/notify.js @@ -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); } diff --git a/apps/notifyfs/notify.js b/apps/notifyfs/notify.js index 07801cedb..71d56acb6 100644 --- a/apps/notifyfs/notify.js +++ b/apps/notifyfs/notify.js @@ -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'); };