From 5c649d37a0ff1b12bcf44b05aed3547cc62c8eb8 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Wed, 11 Jan 2023 20:01:56 +0100 Subject: [PATCH] widget_utils for notanalog --- apps/notanalog/ChangeLog | 3 ++- apps/notanalog/metadata.json | 2 +- apps/notanalog/notanalog.app.js | 5 ++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/notanalog/ChangeLog b/apps/notanalog/ChangeLog index 07430406a..094125f52 100644 --- a/apps/notanalog/ChangeLog +++ b/apps/notanalog/ChangeLog @@ -2,4 +2,5 @@ 0.02: 12k steps are 360 degrees - improves readability of steps. 0.03: Battery improvements through sleep (no minute updates) and partial updates of drawing. 0.04: Use alarm for timer instead of own alarm implementation. -0.05: Use internal step counter if no widget is available. \ No newline at end of file +0.05: Use internal step counter if no widget is available. +0.06: Use widget_utils. diff --git a/apps/notanalog/metadata.json b/apps/notanalog/metadata.json index 81d79f4f2..319d396a9 100644 --- a/apps/notanalog/metadata.json +++ b/apps/notanalog/metadata.json @@ -3,7 +3,7 @@ "name": "Not Analog", "shortName":"Not Analog", "icon": "notanalog.png", - "version":"0.05", + "version":"0.06", "readme": "README.md", "supports": ["BANGLEJS2"], "description": "An analog watch face for people that can not read analog watch faces.", diff --git a/apps/notanalog/notanalog.app.js b/apps/notanalog/notanalog.app.js index 3c01a921e..29fb1730f 100644 --- a/apps/notanalog/notanalog.app.js +++ b/apps/notanalog/notanalog.app.js @@ -4,6 +4,7 @@ const TIMER_IDX = "notanalog"; const locale = require('locale'); const storage = require('Storage') +const widget_utils = require('widget_utils'); const SETTINGS_FILE = "notanalog.setting.json"; let settings = { alarm: -1, @@ -460,10 +461,8 @@ Bangle.setUI("clock"); Bangle.loadWidgets(); /* * we are not drawing the widgets as we are taking over the whole screen - * so we will blank out the draw() functions of each widget and change the - * area to the top bar doesn't get cleared. */ -for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";} +widget_utils.hide(); // Clear the screen once, at startup and draw clock // g.setTheme({bg:"#fff",fg:"#000",dark:false}).clear();