Skip to content

Commit 4c7556d

Browse files
committed
Merge branch 'master' into fix/promenu-y-offset
Conflicts: apps/promenu/ChangeLog
2 parents 6736850 + 46795ed commit 4c7556d

38 files changed

+3782
-4000
lines changed

apps/alarm/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@
5555
to select an alarm in the main menu.
5656
0.50: Bangle.js 2: Long touch of alarm in main menu toggle it on/off. Touching the icon on
5757
the right will do the same.
58+
0.51: Fix long-touch to enable alarm/timer not updating time (fix #3804)

apps/alarm/app.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,18 @@ function showMainMenu(scroll, group, scrollback) {
8787
};
8888
const getGroups = settings.showGroup && !group;
8989
const groups = getGroups ? {} : undefined;
90-
var showAlarm;
9190
const getIcon = (e)=>{return e.on ? (e.timer ? iconTimerOn : iconAlarmOn) : (e.timer ? iconTimerOff : iconAlarmOff);};
9291

9392
alarms.forEach((e, index) => {
94-
showAlarm = !settings.showGroup || (group ? e.group === group : !e.group);
93+
const showAlarm = !settings.showGroup || (group ? e.group === group : !e.group);
9594
if(showAlarm) {
9695
const label = trimLabel(getLabel(e),40);
9796
menu[label] = {
9897
value: e.on,
9998
onchange: (v, touch) => {
10099
if (touch && (2==touch.type || 145<touch.x)) { // Long touch or touched icon.
101100
e.on = v;
101+
if (e.on) prepareForSave(e, index);
102102
saveAndReload();
103103
} else {
104104
setTimeout(e.timer ? showEditTimerMenu : showEditAlarmMenu, 10, e, index, undefined, scroller?scroller.scroll:undefined, group);
@@ -328,6 +328,14 @@ function prepareAlarmForSave(alarm, alarmIndex, time, date, temp) {
328328
}
329329
}
330330

331+
function prepareForSave(alarm, alarmIndex) {
332+
if (alarm.timer) {
333+
prepareTimerForSave(alarm, alarmIndex, require("time_utils").decodeTime(alarm.timer));
334+
} else {
335+
prepareAlarmForSave(alarm, alarmIndex, require("time_utils").decodeTime(alarm.t));
336+
}
337+
}
338+
331339
function saveAndReload() {
332340
// Before saving revert the dow to the standard format (alarms only!)
333341
alarms.filter(e => e.timer === undefined).forEach(a => a.dow = handleFirstDayOfWeek(a.dow));
@@ -574,13 +582,7 @@ function enableAll(on) {
574582
if (confirm) {
575583
alarms.forEach((alarm, i) => {
576584
alarm.on = on;
577-
if (on) {
578-
if (alarm.timer) {
579-
prepareTimerForSave(alarm, i, require("time_utils").decodeTime(alarm.timer));
580-
} else {
581-
prepareAlarmForSave(alarm, i, require("time_utils").decodeTime(alarm.t));
582-
}
583-
}
585+
if (on) prepareForSave(alarm, i);
584586
});
585587
saveAndReload();
586588
showMainMenu();

apps/alarm/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "alarm",
33
"name": "Alarms & Timers",
44
"shortName": "Alarms",
5-
"version": "0.50",
5+
"version": "0.51",
66
"description": "Set alarms and timers on your Bangle",
77
"icon": "app.png",
88
"tags": "tool,alarm",

apps/edgeclk/ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
0.02: Fix reset of progress bars on midnight. Fix display of 100k+ steps.
33
0.03: Added option to display weather.
44
0.04: Added option to display live updates of step count.
5+
0.05: Reset graphics before initial clearing of the screen. Helps in some
6+
situations if using fastload utils.

apps/edgeclk/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@
336336
/* Startup Process
337337
------------------------------------------------------------------------------*/
338338

339-
g.clear();
339+
g.clear(1);
340340
drawAll();
341341
startTimers();
342342
registerEvents();

apps/edgeclk/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "edgeclk",
33
"name": "Edge Clock",
44
"shortName": "Edge Clock",
5-
"version": "0.04",
5+
"version": "0.05",
66
"description": "Crisp clock with perfect readability.",
77
"readme": "README.md",
88
"icon": "app.png",

apps/folderlaunch/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
* @param _button 1 for left half, 2 for right half
175175
* @param xy postion on screen
176176
*/
177-
let onTouch = function (_button: number, xy: { x: number, y: number } | undefined) {
177+
let onTouch = function (_button, xy) {
178178
// Determine which grid cell was tapped
179179
let x: number = Math.floor((xy!.x - 12) / ((g.getWidth() - 24) / config.display.rows));
180180
if (x < 0) x = 0;
@@ -206,7 +206,7 @@
206206
break;
207207
}
208208
}
209-
}
209+
} satisfies TouchCallback;
210210

211211
let page: number = 0;
212212
let nPages: number; // Set when setting folder

apps/jsonclock/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
0.01: first release
22
0.02: memory leak fix; color changes to better align with VSCode color scheme; logo is transparent
3+
0.03: Fixed redrawing of commas

apps/jsonclock/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ let redraw = function() {
229229
if (!(key in valsArrs)) continue;
230230
let valsArr = valsArrs[key];
231231
if (value === valsArr.text) continue; // No need to update
232+
if (valsArr.endComma) value = value.slice(0, -1);
232233
valsArrs[key].text = value;
233234

234235
// Clear prev values
@@ -239,7 +240,7 @@ let redraw = function() {
239240
g.drawString(value, valsArr.x, valsArr.y);
240241
if (valsArr.endComma){
241242
g.setColor(clrs.brackets);
242-
g.drawString(',', valsArr.Banglex + g.stringWidth(value), valsArr.y);
243+
g.drawString(',', valsArr.x + g.stringWidth(value), valsArr.y);
243244
}
244245
}
245246
};

apps/jsonclock/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ "id": "jsonclock",
22
"name": "JsonClock",
3-
"version": "0.02",
3+
"version": "0.03",
44
"description": "JSON view of the time, date, steps, battery, and sunrise and sunset times",
55
"icon": "app.png",
66
"screenshots": [{"url":"dark.png"}],

0 commit comments

Comments
 (0)