From 8893d2431cbf9aab05f741e245422fba01ac57bc Mon Sep 17 00:00:00 2001 From: Alexander Browne Date: Sat, 31 May 2025 15:42:46 -0500 Subject: [PATCH] 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);