Clock apps tell clock widgets to hide

pull/2113/head
thyttan 2022-09-06 18:38:13 +02:00
parent 8f25103d37
commit 5b1b3553c5
30 changed files with 63 additions and 43 deletions

View File

@ -1,2 +1,3 @@
0.01: New App! 0.01: New App!
0.02: Fullscreen settings. 0.02: Fullscreen settings.
0.03: Tell clock widgets to hide.

View File

@ -115,6 +115,9 @@ function draw() {
} }
} }
// Show launcher when middle button pressed
Bangle.setUI("clock");
Bangle.loadWidgets(); Bangle.loadWidgets();
// Clear the screen once, at startup // Clear the screen once, at startup
@ -140,5 +143,3 @@ Bangle.on('lock', function(isLocked) {
}); });
// Show launcher when middle button pressed
Bangle.setUI("clock");

View File

@ -1,7 +1,7 @@
{ {
"id": "90sclk", "id": "90sclk",
"name": "90s Clock", "name": "90s Clock",
"version": "0.02", "version": "0.03",
"description": "A 90s style watch-face", "description": "A 90s style watch-face",
"readme": "README.md", "readme": "README.md",
"icon": "app.png", "icon": "app.png",

View File

@ -1,2 +1,3 @@
0.01: AdvCasio first version 0.01: AdvCasio first version
0.02: Remove un-needed fonts to improve memory usage 0.02: Remove un-needed fonts to improve memory usage
0.03: Tell clock widgets to hide.

View File

@ -294,9 +294,10 @@ Bangle.on("lock", (locked) => {
}); });
Bangle.setUI("clock");
// Load widgets, but don't show them // Load widgets, but don't show them
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.setUI("clock");
g.reset(); g.reset();
g.clear(); g.clear();

View File

@ -1,7 +1,7 @@
{ "id": "advcasio", { "id": "advcasio",
"name": "Advanced Casio Clock", "name": "Advanced Casio Clock",
"shortName":"advcasio", "shortName":"advcasio",
"version":"0.02", "version":"0.03",
"description": "An over-engineered clock inspired by Casio watches. It has a 4 days weather, a timer using swipe and a scratchpad. Can be updated using a dedicated webapp.", "description": "An over-engineered clock inspired by Casio watches. It has a 4 days weather, a timer using swipe and a scratchpad. Can be updated using a dedicated webapp.",
"icon": "app.png", "icon": "app.png",
"tags": "clock", "tags": "clock",

View File

@ -1,3 +1,5 @@
0.01: New App! 0.01: New App!
0.02: Fix bug if image clock wasn't installed 0.02: Fix bug if image clock wasn't installed
0.03: Update to use setUI 0.03: Update to use setUI
0.04; Tell clock widgets to hide. Move loadWidgets() so it only runs on
startup and not on every draw.

View File

@ -87,7 +87,6 @@ if (g.drawImages) {
draw(); draw();
var secondInterval = setInterval(draw,100); var secondInterval = setInterval(draw,100);
// load widgets // load widgets
Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
// Stop when LCD goes off // Stop when LCD goes off
Bangle.on('lcdPower',on=>{ Bangle.on('lcdPower',on=>{
@ -104,3 +103,5 @@ if (g.drawImages) {
} }
// Show launcher when button pressed // Show launcher when button pressed
Bangle.setUI("clock"); Bangle.setUI("clock");
Bangle.loadWidgets();

View File

@ -2,7 +2,7 @@
"id": "animclk", "id": "animclk",
"name": "Animated Clock", "name": "Animated Clock",
"shortName": "Anim Clock", "shortName": "Anim Clock",
"version": "0.03", "version": "0.04",
"description": "An animated clock face using Mark Ferrari's amazing 8 bit game art and palette cycling: http://www.markferrari.com/art/8bit-game-art", "description": "An animated clock face using Mark Ferrari's amazing 8 bit game art and palette cycling: http://www.markferrari.com/art/8bit-game-art",
"icon": "app.png", "icon": "app.png",
"type": "clock", "type": "clock",

View File

@ -1,3 +1,4 @@
0.01: Create astral clock app 0.01: Create astral clock app
0.02: Fixed Whirlpool galaxy RA/DA, larger compass display, fixed moonphase overlapping battery widget 0.02: Fixed Whirlpool galaxy RA/DA, larger compass display, fixed moonphase overlapping battery widget
0.03: Update to use Bangle.setUI instead of setWatch 0.03: Update to use Bangle.setUI instead of setWatch
0.04: Tell clock widgets to hide.

View File

@ -767,6 +767,24 @@ function draw() {
g.clear(); g.clear();
current_moonphase = getMoonPhase(); current_moonphase = getMoonPhase();
Bangle.setUI("clockupdown", btn => {
if (btn==0) {
if (!processing) {
if (!modeswitch) {
modeswitch = true;
if (mode == "planetary") mode = "extras";
else mode = "planetary";
}
else
modeswitch = false;
}
} else {
if (!processing)
ready_to_compute = true;
}
});
// Load widgets // Load widgets
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
@ -799,23 +817,6 @@ Bangle.setGPSPower(1);
// Show launcher when button pressed // Show launcher when button pressed
Bangle.setClockMode(); Bangle.setClockMode();
Bangle.setUI("clockupdown", btn => {
if (btn==0) {
if (!processing) {
if (!modeswitch) {
modeswitch = true;
if (mode == "planetary") mode = "extras";
else mode = "planetary";
}
else
modeswitch = false;
}
} else {
if (!processing)
ready_to_compute = true;
}
});
setWatch(function () { setWatch(function () {
if (!astral_settings.astral_default) { if (!astral_settings.astral_default) {
colours_switched = true; colours_switched = true;

View File

@ -1,7 +1,7 @@
{ {
"id": "astral", "id": "astral",
"name": "Astral Clock", "name": "Astral Clock",
"version": "0.03", "version": "0.04",
"description": "Clock that calculates and displays Alt Az positions of all planets, Sun as well as several other astronomy targets (customizable) and current Moon phase. Coordinates are calculated by GPS & time and onscreen compass assists orienting. See Readme before using.", "description": "Clock that calculates and displays Alt Az positions of all planets, Sun as well as several other astronomy targets (customizable) and current Moon phase. Coordinates are calculated by GPS & time and onscreen compass assists orienting. See Readme before using.",
"icon": "app-icon.png", "icon": "app-icon.png",
"type": "clock", "type": "clock",

View File

@ -7,3 +7,4 @@
0.07: Step count resets at midnight 0.07: Step count resets at midnight
0.08: Step count stored in memory to survive reloads. Now shows step count daily and since last reboot. 0.08: Step count stored in memory to survive reloads. Now shows step count daily and since last reboot.
0.09: NOW it really should reset daily (instead of every other day...) 0.09: NOW it really should reset daily (instead of every other day...)
0.10: Tell clock widgets to hide.

View File

@ -416,13 +416,13 @@ var layout = new Layout( {
// Clear the screen once, at startup // Clear the screen once, at startup
g.clear(); g.clear();
Bangle.setUI("clock");
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
Bangle.setUI("clock");
layout.render(); layout.render();
Bangle.on('lock', function(locked) { Bangle.on('lock', function(locked) {
if(!locked) { if(!locked) {
layout.render(); layout.render();
} }
}); });

View File

@ -2,7 +2,7 @@
"name": "Barcode clock", "name": "Barcode clock",
"shortName":"Barcode clock", "shortName":"Barcode clock",
"icon": "barcode.icon.png", "icon": "barcode.icon.png",
"version":"0.09", "version":"0.10",
"description": "EAN-8 compatible barcode clock.", "description": "EAN-8 compatible barcode clock.",
"tags": "barcode,ean,ean-8,watchface,clock,clockface", "tags": "barcode,ean,ean-8,watchface,clock,clockface",
"type": "clock", "type": "clock",

View File

@ -1,2 +1,3 @@
0.01: App Created! 0.01: App Created!
0.02: Update to use Bangle.setUI instead of setWatch 0.02: Update to use Bangle.setUI instead of setWatch
0.03: Tell clock widgets to hide.

View File

@ -249,6 +249,9 @@ g.clear();
g.setColor(0, 0.5, 0).drawImage(bg_crack); g.setColor(0, 0.5, 0).drawImage(bg_crack);
g.setColor(1, 1, 1).drawImage(batman); g.setColor(1, 1, 1).drawImage(batman);
// Show launcher when button pressed
Bangle.setUI("clock");
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
@ -256,5 +259,3 @@ Bangle.drawWidgets();
timeInterval = setInterval(showTime, 1000); timeInterval = setInterval(showTime, 1000);
showTime(); showTime();
// Show launcher when button pressed
Bangle.setUI("clock");

View File

@ -2,7 +2,7 @@
"id": "batclock", "id": "batclock",
"name": "Bat Clock", "name": "Bat Clock",
"shortName": "Bat Clock", "shortName": "Bat Clock",
"version": "0.02", "version": "0.03",
"description": "Morphing Clock, with an awesome \"The Dark Knight\" themed logo.", "description": "Morphing Clock, with an awesome \"The Dark Knight\" themed logo.",
"icon": "bat-clock.png", "icon": "bat-clock.png",
"screenshots": [{"url":"screenshot.png"}], "screenshots": [{"url":"screenshot.png"}],

View File

@ -1,2 +1,3 @@
0.02: Modified for use with new bootloader and firmware 0.02: Modified for use with new bootloader and firmware
0.03: Update to use Bangle.setUI instead of setWatch 0.03: Update to use Bangle.setUI instead of setWatch
0.04: Tell clock widgets to hide.

View File

@ -100,10 +100,12 @@ Bangle.on('lcdPower', on => {
if (on) drawClock(); if (on) drawClock();
}); });
// Show launcher when button pressed
Bangle.setUI("clock");
g.clear(); g.clear();
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
setInterval(() => { drawClock(); }, 1000); setInterval(() => { drawClock(); }, 1000);
drawClock(); drawClock();
// Show launcher when button pressed
Bangle.setUI("clock");

View File

@ -1,7 +1,7 @@
{ {
"id": "bclock", "id": "bclock",
"name": "Binary Clock", "name": "Binary Clock",
"version": "0.03", "version": "0.04",
"description": "A simple binary clock watch face", "description": "A simple binary clock watch face",
"icon": "clock-binary.png", "icon": "clock-binary.png",
"type": "clock", "type": "clock",

View File

@ -3,3 +3,4 @@
0.03: Internationalisation; bug fix - battery icon responds promptly to charging state 0.03: Internationalisation; bug fix - battery icon responds promptly to charging state
0.04: bug fix 0.04: bug fix
0.05: proper fix for the race condition in queueDraw() 0.05: proper fix for the race condition in queueDraw()
0.06: Tell clock widgets to hide.

View File

@ -85,7 +85,8 @@ Bangle.on('charging', (charging) => {
draw(); draw();
}); });
Bangle.setUI("clock");
Bangle.loadWidgets(); Bangle.loadWidgets();
draw(); draw();
Bangle.setUI("clock");

View File

@ -1,7 +1,7 @@
{ "id": "bigdclock", { "id": "bigdclock",
"name": "Big digit clock containing just the essentials", "name": "Big digit clock containing just the essentials",
"shortName":"Big digit clk", "shortName":"Big digit clk",
"version":"0.05", "version":"0.06",
"description": "A clock containing just the essentials, made as easy to read as possible for those of us that need glasses. It contains the time, the day-of-week, the day-of-month, and the current battery state-of-charge.", "description": "A clock containing just the essentials, made as easy to read as possible for those of us that need glasses. It contains the time, the day-of-week, the day-of-month, and the current battery state-of-charge.",
"icon": "bigdclock.png", "icon": "bigdclock.png",
"type": "clock", "type": "clock",

View File

@ -1,3 +1,4 @@
0.01: New App! 0.01: New App!
0.02: Fixed bug where screen didn't clear so incorrect time displayed. 0.02: Fixed bug where screen didn't clear so incorrect time displayed.
0.03: Update to use Bangle.setUI instead of setWatch 0.03: Update to use Bangle.setUI instead of setWatch
0.04: Tell clock widgets to hide.

View File

@ -164,9 +164,6 @@ Bangle.on('lcdPower',on=>{
draw(); // draw immediately draw(); // draw immediately
} }
}); });
// Load widgets
Bangle.loadWidgets();
Bangle.drawWidgets();
// Show launcher when button pressed // Show launcher when button pressed
Bangle.setUI("clockupdown", btn=>{ Bangle.setUI("clockupdown", btn=>{
if (btn!=1) return; if (btn!=1) return;
@ -176,3 +173,6 @@ Bangle.setUI("clockupdown", btn=>{
displayTime = 0; displayTime = 0;
} }
}); });
// Load widgets
Bangle.loadWidgets();
Bangle.drawWidgets();

View File

@ -2,7 +2,7 @@
"id": "binclock", "id": "binclock",
"name": "Binary Clock", "name": "Binary Clock",
"shortName": "Binary Clock", "shortName": "Binary Clock",
"version": "0.03", "version": "0.04",
"description": "A binary clock with hours and minutes. BTN1 toggles a digital clock.", "description": "A binary clock with hours and minutes. BTN1 toggles a digital clock.",
"icon": "app.png", "icon": "app.png",
"type": "clock", "type": "clock",

View File

@ -2,3 +2,5 @@
0.02: first running version for BangleJs2 0.02: first running version for BangleJs2
0.03: corrected icon, added screen shot, extended description 0.03: corrected icon, added screen shot, extended description
0.04: corrected format of background image (raw binary) 0.04: corrected format of background image (raw binary)
0.05: move setUI() up before draw() as to not have a false positive 'sanity
check' when building on github.

View File

@ -334,6 +334,7 @@ function setRuntimeValues(resolution) {
var hour = 0, minute = 1, second = 50; var hour = 0, minute = 1, second = 50;
var batVLevel = 20; var batVLevel = 20;
Bangle.setUI("clock");
function draw() { function draw() {
var d = new Date(); var d = new Date();
@ -371,7 +372,6 @@ function draw() {
} }
// Show launcher when button pressed // Show launcher when button pressed
Bangle.setUI("clock");
setRuntimeValues(g.getWidth()); setRuntimeValues(g.getWidth());
g.reset().clear(); g.reset().clear();
Bangle.loadWidgets(); Bangle.loadWidgets();

View File

@ -3,7 +3,7 @@
"shortName":"BinWatch", "shortName":"BinWatch",
"icon": "app.png", "icon": "app.png",
"screenshots": [{"url":"screenshot.png"}], "screenshots": [{"url":"screenshot.png"}],
"version":"0.04", "version":"0.05",
"supports": ["BANGLEJS2"], "supports": ["BANGLEJS2"],
"readme": "README.md", "readme": "README.md",
"allow_emulator":true, "allow_emulator":true,