From 0da99ce3ffc6f02d1c7857427807876567c58654 Mon Sep 17 00:00:00 2001 From: OmegaRogue Date: Wed, 9 Dec 2020 14:24:02 +0100 Subject: [PATCH] Optimized Battery display --- apps/dane/app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/dane/app.js b/apps/dane/app.js index 7a3cb6f6e..0fbd8b3d7 100644 --- a/apps/dane/app.js +++ b/apps/dane/app.js @@ -73,6 +73,10 @@ function drawBattery() { g.setColor(c).fillRect(46, 58 + 80 + yOffset + 37, xl, height - 5); } +function updateCounter() { + drawBattery(); + drawCounterText(); +} function drawClock() { // main frame @@ -89,7 +93,7 @@ function drawClock() { Arwes.drawFrameNoCorners(44, 58 + 80 + yOffset + 35, 196, height - 3); - drawBattery(); + updateCounter() updateClock(); // const img = makeImg(); @@ -101,7 +105,7 @@ function updateClock() { const date = new Date(); drawTimeText(date); drawDateText(date); - drawCounterText(); + } @@ -131,6 +135,6 @@ setWatch(Bangle.showLauncher, BTN2, {repeat: false, edge: "falling"}); // refesh every 100 milliseconds setInterval(updateClock, 500); -setInterval(drawBattery, 1000); +setInterval(updateCounter, 1000);