1
0
Fork 0

Clock apps tell clock widgets to hide #7

master
thyttan 2022-09-07 01:09:46 +02:00
parent ab15ed66a2
commit 11e34f73b4
12 changed files with 37 additions and 33 deletions

View File

@ -1,2 +1,3 @@
... ...
0.02: First update with ChangeLog Added 0.02: First update with ChangeLog Added
0.03: Tell clock widgets to hide.

View File

@ -225,6 +225,6 @@
} }
}); });
Bangle.loadWidgets();
Bangle.setUI('clock'); Bangle.setUI('clock');
Bangle.loadWidgets();

View File

@ -1,7 +1,7 @@
{ "id": "simple_clock", { "id": "simple_clock",
"name": "Simple Analog Clock", "name": "Simple Analog Clock",
"shortName":"Simple Clock", "shortName":"Simple Clock",
"version":"0.02", "version":"0.03",
"description": "a simple, yet stylish, analog clock", "description": "a simple, yet stylish, analog clock",
"icon": "app-icon.png", "icon": "app-icon.png",
"type": "clock", "type": "clock",

View File

@ -1,2 +1,3 @@
0.01: Initial release on the app repository for Bangle.js 1 and 2 0.01: Initial release on the app repository for Bangle.js 1 and 2
0.02: Fixed let/const usage while using firmware version >=2v14 0.02: Fixed let/const usage while using firmware version >=2v14
0.03: Tell clock widgets to hide.

View File

@ -334,10 +334,10 @@ updateStardate();
updateConventionalTime(); updateConventionalTime();
// Make sure widgets can be shown. // Make sure widgets can be shown.
//g.setColor("#FF0000"); g.fillRect(0, 0, g.getWidth(), widgetsHeight); // debug //g.setColor("#FF0000"); g.fillRect(0, 0, g.getWidth(), widgetsHeight); // debug
Bangle.loadWidgets();
Bangle.drawWidgets();
// Show launcher on button press as usual for a clock face // Show launcher on button press as usual for a clock face
Bangle.setUI("clock", Bangle.showLauncher); Bangle.setUI("clock", Bangle.showLauncher);
Bangle.loadWidgets();
Bangle.drawWidgets();
// Stop updates when LCD is off, restart when on // Stop updates when LCD is off, restart when on
Bangle.on('lcdPower', on => { Bangle.on('lcdPower', on => {
if (on) { if (on) {

View File

@ -3,7 +3,7 @@
"name":"Stardate Clock", "name":"Stardate Clock",
"shortName":"Stardate Clock", "shortName":"Stardate Clock",
"description": "A clock displaying a stardate along with a 'standard' digital/analog clock in LCARS design", "description": "A clock displaying a stardate along with a 'standard' digital/analog clock in LCARS design",
"version":"0.02", "version":"0.03",
"icon": "app.png", "icon": "app.png",
"type":"clock", "type":"clock",
"tags": "clock", "tags": "clock",

View File

@ -4,3 +4,4 @@
0.07: Added leading zero to hours and minutes 0.07: Added leading zero to hours and minutes
0.08: Show step count by calling wpedom.getSteps() or activepedom.getSteps() 0.08: Show step count by calling wpedom.getSteps() or activepedom.getSteps()
0.09: Fix time when minutes<10 and hours>9 (fix #767) 0.09: Fix time when minutes<10 and hours>9 (fix #767)
0.10: Tell clock widgets to hide.

View File

@ -97,6 +97,28 @@ function drawBattery() {
// Clear the screen once, at startup // Clear the screen once, at startup
g.clear(); g.clear();
// Show launcher when button pressed
Bangle.setUI("clockupdown", btn=>{
if (btn!=0) return;
//HRM Controller.
if(!HRMstate){
//console.log("Toggled HRM");
//Turn on.
Bangle.buzz();
Bangle.setHRMPower(1);
currentHRM = "CALC";
HRMstate = true;
} else if(HRMstate){
//console.log("Toggled HRM");
//Turn off.
Bangle.buzz();
Bangle.setHRMPower(0);
HRMstate = false;
currentHRM = [];
}
drawBPM(HRMstate);
});
// Load and draw widgets // Load and draw widgets
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
@ -128,28 +150,6 @@ Bangle.on('lcdPower',on=>{
} }
}); });
// Show launcher when button pressed
Bangle.setUI("clockupdown", btn=>{
if (btn!=0) return;
//HRM Controller.
if(!HRMstate){
//console.log("Toggled HRM");
//Turn on.
Bangle.buzz();
Bangle.setHRMPower(1);
currentHRM = "CALC";
HRMstate = true;
} else if(HRMstate){
//console.log("Toggled HRM");
//Turn off.
Bangle.buzz();
Bangle.setHRMPower(0);
HRMstate = false;
currentHRM = [];
}
drawBPM(HRMstate);
});
Bangle.on('touch', function(button) { Bangle.on('touch', function(button) {
if(button == 1 || button == 2){ if(button == 1 || button == 2){
Bangle.showLauncher(); Bangle.showLauncher();

View File

@ -2,7 +2,7 @@
"id": "verticalface", "id": "verticalface",
"name": "Vertical watch face", "name": "Vertical watch face",
"shortName": "Vertical Face", "shortName": "Vertical Face",
"version": "0.09", "version": "0.10",
"description": "A simple vertical watch face with the date. Heart rate monitor is toggled with BTN1", "description": "A simple vertical watch face with the date. Heart rate monitor is toggled with BTN1",
"icon": "app.png", "icon": "app.png",
"type": "clock", "type": "clock",

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: setUI and support for different screens 0.03: setUI and support for different screens
0.04: Tell clock widgets to hide.

View File

@ -122,11 +122,11 @@ Bangle.on('lcdPower', function(on) {
if (on) drawWordClock(); if (on) drawWordClock();
}); });
// Show launcher when button pressed
Bangle.setUI("clock");
g.clear(); g.clear();
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();
setInterval(drawWordClock, 1E4); setInterval(drawWordClock, 1E4);
drawWordClock(); drawWordClock();
// Show launcher when button pressed
Bangle.setUI("clock");

View File

@ -1,7 +1,7 @@
{ {
"id": "wclock", "id": "wclock",
"name": "Word Clock", "name": "Word Clock",
"version": "0.03", "version": "0.04",
"description": "Display Time as Text", "description": "Display Time as Text",
"icon": "clock-word.png", "icon": "clock-word.png",
"screenshots": [{"url":"screenshot_word.png"}], "screenshots": [{"url":"screenshot_word.png"}],