From cd50676977709279e4cb73e4662387a50cfd8e99 Mon Sep 17 00:00:00 2001 From: elcste Date: Thu, 29 May 2025 16:33:45 -0500 Subject: [PATCH 1/5] Add setting to show the weekday and not the year --- apps/andark/ChangeLog | 1 + apps/andark/README.md | 1 + apps/andark/app.js | 7 +++++-- apps/andark/metadata.json | 2 +- apps/andark/settings.js | 7 ++++++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/andark/ChangeLog b/apps/andark/ChangeLog index fa89d5618..6e7bf4fd1 100644 --- a/apps/andark/ChangeLog +++ b/apps/andark/ChangeLog @@ -7,3 +7,4 @@ 0.06: Fix issue showing widgets when app is fast-loaded into from launcher with widgets disabled 0.07: Enable fast loading and queue updates to the second 0.08: Restore redraw on charging event + fixup for safer fast-loading +0.09: Add setting to show the weekday and not the year diff --git a/apps/andark/README.md b/apps/andark/README.md index 9034677c2..7873417fb 100644 --- a/apps/andark/README.md +++ b/apps/andark/README.md @@ -14,3 +14,4 @@ * whether to load widgets, or not; if widgets are loaded, they are swipeable from the top; if not, NO ACTIONS of widgets are available * date and battery can be printed both below hands (as if hands were physical) and above (more readable) * hour hand can be made slighly shorter to improve readability when minute hand is behind a number +* show the weekday and not the year diff --git a/apps/andark/app.js b/apps/andark/app.js index 81d757ce4..f94369217 100644 --- a/apps/andark/app.js +++ b/apps/andark/app.js @@ -2,7 +2,8 @@ const defaultSettings = { loadWidgets : false, textAboveHands : false, - shortHrHand : false + shortHrHand : false, + weekdayNoYear : false }; const settings = Object.assign(defaultSettings, require('Storage').readJSON('andark.json',1)||{}); @@ -65,7 +66,9 @@ const drawText = function(d) { g.setFont("Vector",10); g.setBgColor(0,0,0); g.setColor(1,1,1); - const dateStr = require("locale").date(d); + const dateStr = settings.weekdayNoYear + ? require("locale").dow(d, 1)+" "+d.getDate()+" "+require("locale").month(d, 1) + : require("locale").date(d); g.drawString(dateStr, c.x, c.y+20, true); const batStr = Math.round(E.getBattery()/5)*5+"%"; if (Bangle.isCharging()) { diff --git a/apps/andark/metadata.json b/apps/andark/metadata.json index 4bd88b3f5..e45cdae4f 100644 --- a/apps/andark/metadata.json +++ b/apps/andark/metadata.json @@ -1,7 +1,7 @@ { "id": "andark", "name": "Analog Dark", "shortName":"AnDark", - "version":"0.08", + "version":"0.09", "description": "analog clock face without disturbing widgets", "icon": "andark_icon.png", "type": "clock", diff --git a/apps/andark/settings.js b/apps/andark/settings.js index 7bbceb2c2..f03919358 100644 --- a/apps/andark/settings.js +++ b/apps/andark/settings.js @@ -2,7 +2,8 @@ const defaultSettings = { loadWidgets : false, textAboveHands : false, - shortHrHand : false + shortHrHand : false, + weekdayNoYear : false } let settings = Object.assign(defaultSettings, require('Storage').readJSON('andark.json',1)||{}); @@ -22,6 +23,10 @@ value : !!settings.shortHrHand, onchange : v => { settings.shortHrHand=v; save();} }, + /*LANG*/'Show weekday not year': { + value : !!settings.weekdayNoYear, + onchange : v => { settings.weekdayNoYear=v; save();} + }, }; E.showMenu(appMenu); From 5f34461991cf78774b077ecad6cd41845e6c8eee Mon Sep 17 00:00:00 2001 From: elcste Date: Thu, 29 May 2025 16:37:36 -0500 Subject: [PATCH 2/5] Add setting to hide the battery percentage --- apps/andark/ChangeLog | 2 +- apps/andark/README.md | 1 + apps/andark/app.js | 18 ++++++++++++------ apps/andark/settings.js | 7 ++++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/apps/andark/ChangeLog b/apps/andark/ChangeLog index 6e7bf4fd1..731a84506 100644 --- a/apps/andark/ChangeLog +++ b/apps/andark/ChangeLog @@ -7,4 +7,4 @@ 0.06: Fix issue showing widgets when app is fast-loaded into from launcher with widgets disabled 0.07: Enable fast loading and queue updates to the second 0.08: Restore redraw on charging event + fixup for safer fast-loading -0.09: Add setting to show the weekday and not the year +0.09: Add setting to show the weekday and not the year + add setting to hide the battery diff --git a/apps/andark/README.md b/apps/andark/README.md index 7873417fb..71575544c 100644 --- a/apps/andark/README.md +++ b/apps/andark/README.md @@ -15,3 +15,4 @@ * date and battery can be printed both below hands (as if hands were physical) and above (more readable) * hour hand can be made slighly shorter to improve readability when minute hand is behind a number * show the weekday and not the year +* hide the battery percentage diff --git a/apps/andark/app.js b/apps/andark/app.js index f94369217..464ddd689 100644 --- a/apps/andark/app.js +++ b/apps/andark/app.js @@ -3,7 +3,8 @@ const defaultSettings = { loadWidgets : false, textAboveHands : false, shortHrHand : false, - weekdayNoYear : false + weekdayNoYear : false, + noBattery : false }; const settings = Object.assign(defaultSettings, require('Storage').readJSON('andark.json',1)||{}); @@ -63,18 +64,23 @@ const drawHands = function(d) { }; const drawText = function(d) { - g.setFont("Vector",10); g.setBgColor(0,0,0); g.setColor(1,1,1); const dateStr = settings.weekdayNoYear ? require("locale").dow(d, 1)+" "+d.getDate()+" "+require("locale").month(d, 1) : require("locale").date(d); - g.drawString(dateStr, c.x, c.y+20, true); const batStr = Math.round(E.getBattery()/5)*5+"%"; - if (Bangle.isCharging()) { - g.setBgColor(1,0,0); + if (settings.noBattery) { + g.setFont("Vector",13); + g.drawString(dateStr, c.x, c.y+25, true); + } else { + g.setFont("Vector",10); + g.drawString(dateStr, c.x, c.y+20, true); + if (Bangle.isCharging()) { + g.setBgColor(1,0,0); + } + g.drawString(batStr, c.x, c.y+40, true); } - g.drawString(batStr, c.x, c.y+40, true); }; const drawNumbers = function() { diff --git a/apps/andark/settings.js b/apps/andark/settings.js index f03919358..886d1d755 100644 --- a/apps/andark/settings.js +++ b/apps/andark/settings.js @@ -3,7 +3,8 @@ loadWidgets : false, textAboveHands : false, shortHrHand : false, - weekdayNoYear : false + weekdayNoYear : false, + noBattery : false } let settings = Object.assign(defaultSettings, require('Storage').readJSON('andark.json',1)||{}); @@ -27,6 +28,10 @@ value : !!settings.weekdayNoYear, onchange : v => { settings.weekdayNoYear=v; save();} }, + /*LANG*/'Hide the battery': { + value : !!settings.noBattery, + onchange : v => { settings.noBattery=v; save();} + }, }; E.showMenu(appMenu); From 5353420ace1b22d7ea6ba80d286464d8342ffca9 Mon Sep 17 00:00:00 2001 From: Alexander Browne Date: Fri, 30 May 2025 07:34:52 -0500 Subject: [PATCH 3/5] Changed to follow system them with setting for dark theme --- apps/andark/ChangeLog | 3 ++- apps/andark/README.md | 1 + apps/andark/app.js | 27 +++++++++++++++++---------- apps/andark/settings.js | 7 ++++++- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/apps/andark/ChangeLog b/apps/andark/ChangeLog index 731a84506..5541288e8 100644 --- a/apps/andark/ChangeLog +++ b/apps/andark/ChangeLog @@ -7,4 +7,5 @@ 0.06: Fix issue showing widgets when app is fast-loaded into from launcher with widgets disabled 0.07: Enable fast loading and queue updates to the second 0.08: Restore redraw on charging event + fixup for safer fast-loading -0.09: Add setting to show the weekday and not the year + add setting to hide the battery +0.09: Add setting to show the weekday and not the year + add setting to hide the battery + + changed to follow system them with setting for dark theme diff --git a/apps/andark/README.md b/apps/andark/README.md index 71575544c..c02964ea0 100644 --- a/apps/andark/README.md +++ b/apps/andark/README.md @@ -16,3 +16,4 @@ * hour hand can be made slighly shorter to improve readability when minute hand is behind a number * show the weekday and not the year * hide the battery percentage +* dark theme (enabled by default); disable to follow system theme diff --git a/apps/andark/app.js b/apps/andark/app.js index 464ddd689..be8e969f4 100644 --- a/apps/andark/app.js +++ b/apps/andark/app.js @@ -4,10 +4,16 @@ const defaultSettings = { textAboveHands : false, shortHrHand : false, weekdayNoYear : false, - noBattery : false + noBattery : false, + darkTheme : true }; const settings = Object.assign(defaultSettings, require('Storage').readJSON('andark.json',1)||{}); +if (settings.darkTheme) { + g.setTheme({bg: "#000"}); + g.setTheme({fg: "#FFF"}); +} + const c={"x":g.getWidth()/2,"y":g.getHeight()/2}; const zahlpos=(function() { @@ -38,7 +44,7 @@ const zeiger = function(len,dia,tim) { const drawHands = function(d) { let m=d.getMinutes(), h=d.getHours(), s=d.getSeconds(); - g.setColor(1,1,1); + g.setColor(g.theme.fg); if(h>12){ h=h-12; @@ -64,8 +70,9 @@ const drawHands = function(d) { }; const drawText = function(d) { - g.setBgColor(0,0,0); - g.setColor(1,1,1); +//g.setFont("Vector",10); + g.setBgColor(g.theme.bg); + g.setColor(g.theme.fg); const dateStr = settings.weekdayNoYear ? require("locale").dow(d, 1)+" "+d.getDate()+" "+require("locale").month(d, 1) : require("locale").date(d); @@ -86,8 +93,8 @@ const drawText = function(d) { const drawNumbers = function() { //draws the numbers on the screen g.setFont("Vector",20); - g.setColor(1,1,1); - g.setBgColor(0,0,0); + g.setColor(g.theme.fg); + g.setBgColor(g.theme.bg); for(let i = 0;i<12;i++){ g.drawString(zahlpos[i][0],zahlpos[i][1],zahlpos[i][2],true); } @@ -123,7 +130,7 @@ const queueDraw = function() { const draw = function() { // draw black rectangle in the middle to clear screen from scale and hands - g.setColor(0,0,0); + g.setColor(g.theme.bg); g.fillRect(10,10,2*c.x-10,2*c.x-10); // prepare for drawing the text g.setFontAlign(0,0); @@ -141,7 +148,7 @@ const draw = function() { //draws the scale once the app is startet const drawScale = function() { // clear the screen - g.setBgColor(0,0,0); + g.setBgColor(g.theme.bg); g.clear(); // draw the ticks of the scale for(let i=-14;i<47;i++){ @@ -149,9 +156,9 @@ const drawScale = function() { let d=2; if(i%5==0){d=5;} g.fillPoly(zeiger(300,d,win),true); - g.setColor(0,0,0); + g.setColor(g.theme.bg); g.fillRect(10,10,2*c.x-10,2*c.x-10); - g.setColor(1,1,1); + g.setColor(g.theme.fg); } }; diff --git a/apps/andark/settings.js b/apps/andark/settings.js index 886d1d755..d1cba0e30 100644 --- a/apps/andark/settings.js +++ b/apps/andark/settings.js @@ -4,7 +4,8 @@ textAboveHands : false, shortHrHand : false, weekdayNoYear : false, - noBattery : false + noBattery : false, + darkTheme : true } let settings = Object.assign(defaultSettings, require('Storage').readJSON('andark.json',1)||{}); @@ -32,6 +33,10 @@ value : !!settings.noBattery, onchange : v => { settings.noBattery=v; save();} }, + /*LANG*/'Dark theme': { + value : !!settings.darkTheme, + onchange : v => { settings.darkTheme=v; save();} + }, }; E.showMenu(appMenu); From eefd0c30cd250ce39c59c8216697c3d6c2d491a1 Mon Sep 17 00:00:00 2001 From: elcste Date: Fri, 30 May 2025 10:10:25 -0500 Subject: [PATCH 4/5] Add second screenshot and emulator link --- apps/andark/README.md | 8 +++++++- .../andark_screen_light_weekday_nobatt.png | Bin 0 -> 4839 bytes apps/andark/metadata.json | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 apps/andark/andark_screen_light_weekday_nobatt.png diff --git a/apps/andark/README.md b/apps/andark/README.md index c02964ea0..6cc6ed60f 100644 --- a/apps/andark/README.md +++ b/apps/andark/README.md @@ -7,7 +7,13 @@ * battery percentage (showing charge status with color) * turned off or swipeable widgets (choose in settings) -![logo](andark_screen.png) +![Screenshot of Dark Analog Clock with default settings](andark_screen.png) + +*Default settings* + +![Screenshot of Dark Analog Clock with default settings](andark_screen_light_weekday_nobatt.png) + +*Following system theme, with weekday shown and battery hidden* ## Settings diff --git a/apps/andark/andark_screen_light_weekday_nobatt.png b/apps/andark/andark_screen_light_weekday_nobatt.png new file mode 100644 index 0000000000000000000000000000000000000000..72fa233b7c470af94917a0a7248c75ae84f186db GIT binary patch literal 4839 zcmV)-bGAMy9~_4T^?w~4<0MYVcd zi`!<02_r`x#`1CRl!`|i#*C9boGj8OCzG=!Kknw!ukT$y3p+WzV!tA?nwT78u<-}E zBmKew9D~ROKBo`jq@2Mhz!LpXT@X1=CKveMEde}GJ^yii^|CQdLYkOx6O&>lZu__W zBkMZ^V2J~JK#TyutqAdAfb@5g$#|E`z(*4_OG$J>ppo_`fww6yD8Q|h(k@v@Ku{Yj z`r-giR~@8$;J~!dJ6B?)Nr_vD(MfsqD@`6J9VGyx0HDi4PENaQc?AyvD<|UtFba-^ zTx}xZCR;5duLN)fIN4bh>a`jLIR}>@MquLfLbC%hAt;&F088zn{B+el?6m)pn@q`y zVg>Kci8KRqwPY!)N)6Ox00cU86+!xv0sOrI@OyC&G|tZk&{i}f6PQa5(0I|wlce@V z`nH5u4R8&_Xr|DV5~u?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D<1GNt9%Y7=)}Vag{WD3}_# zR#{l0n;2jusJU4sRjLGV_@TwpFYltdp`auEaWW{thkv-N!;Po)v$Txh>gTkiAPF1-0ootemlR+Q3~oFaoa6;h4lvD%XjMw=K4G4Y`yU9$o Date: Sat, 31 May 2025 15:42:46 -0500 Subject: [PATCH 5/5] Save theme and restore With dark theme otherwise theme stays dark for Fast Loading. Also added to readme that the the font for the date is increased with setting to hide the battery. --- apps/andark/README.md | 2 +- apps/andark/app.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/andark/README.md b/apps/andark/README.md index 6cc6ed60f..04737a7a2 100644 --- a/apps/andark/README.md +++ b/apps/andark/README.md @@ -21,5 +21,5 @@ * date and battery can be printed both below hands (as if hands were physical) and above (more readable) * hour hand can be made slighly shorter to improve readability when minute hand is behind a number * show the weekday and not the year -* hide the battery percentage +* hide the battery percentage; the font for the date is increased since there is more space * dark theme (enabled by default); disable to follow system theme diff --git a/apps/andark/app.js b/apps/andark/app.js index be8e969f4..12c836182 100644 --- a/apps/andark/app.js +++ b/apps/andark/app.js @@ -9,6 +9,7 @@ const defaultSettings = { }; const settings = Object.assign(defaultSettings, require('Storage').readJSON('andark.json',1)||{}); +const origTheme = g.theme; if (settings.darkTheme) { g.setTheme({bg: "#000"}); g.setTheme({fg: "#FFF"}); @@ -168,6 +169,7 @@ const drawScale = function() { Bangle.setUI({ mode: "clock", remove: function() { + if (settings.darkTheme) g.setTheme(origTheme); Bangle.removeListener('lcdPower', updateState); Bangle.removeListener('lock', updateState); Bangle.removeListener('charging', draw);