Skip to content

Commit abc6b67

Browse files
authored
Merge pull request #3008 from xxDUxx/master
ContourClock 0.31
2 parents 08afc6a + 6e608e0 commit abc6b67

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

apps/contourclock/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
0.28: More config options for cleaner look, enabled fast loading
1111
0.29: Fixed a bug that would leave old font files in storage.
1212
0.30: Added options to show widgets and date on twist and tap. New fonts.
13+
0.31: Bugfix, no more freeze.

apps/contourclock/app.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@
3434
extrasTimeout = undefined;
3535
hideExtras();
3636
}, 5000);
37+
extrasShown = false;
3738
};
3839
let drawExtras = function() { //draw date, day of the week and widgets
3940
let date = new Date();
41+
g.reset();
42+
g.clearRect(0, 138, g.getWidth() - 1, 176);
4043
g.setFont("Teletext10x18Ascii").setFontAlign(0, 1);
4144
if (settings.weekday) g.drawString(require("locale").dow(date).toUpperCase(), g.getWidth() / 2, g.getHeight() - 18);
4245
if (settings.date) g.drawString(require('locale').date(date, 1), g.getWidth() / 2, g.getHeight());
@@ -45,21 +48,23 @@
4548
};
4649
let hideExtras = function() {
4750
if (extrasTimeout) clearTimeout(extrasTimeout);
51+
extrasTimeout = undefined; //NEW
52+
g.reset();
4853
g.clearRect(0, 138, g.getWidth() - 1, 176);
4954
require("widget_utils").hide();
50-
extrasShown = false;
55+
extrasShown = false; ///NEW
5156
};
5257
let draw = function() {
58+
if (drawTimeout) clearTimeout(drawTimeout); //NEW
59+
drawTimeout = setTimeout(function() {
60+
drawTimeout = undefined;
61+
draw();
62+
}, 60000 - (Date.now() % 60000));
5363
let date = new Date();
5464
g.reset();
5565
if (extrasShown) drawExtras();
5666
else hideExtras();
5767
require('contourclock').drawClock(settings.fontIndex);
58-
if (drawTimeout) clearTimeout(drawTimeout);
59-
drawTimeout = setTimeout(function() {
60-
drawTimeout = undefined;
61-
draw();
62-
}, 60000 - (Date.now() % 60000));
6368
};
6469
if (settings.hideWhenLocked) {
6570
onLock = locked => {
@@ -83,6 +88,8 @@
8388
Bangle.removeListener('twist', showExtras);
8489
if (drawTimeout) clearTimeout(drawTimeout);
8590
if (extrasTimeout) clearTimeout(extrasTimeout);
91+
drawTimeout = undefined;
92+
extrasTimeout = undefined;
8693
if (settings.hideWhenLocked) require("widget_utils").show();
8794
g.reset();
8895
g.clear();
@@ -91,7 +98,7 @@
9198
g.clear();
9299
if (settings.widgets) {
93100
Bangle.loadWidgets();
94-
Bangle.drawWidgets();
101+
setTimeout(Bangle.drawWidgets,0); //NEW
95102
}
96103
draw();
97104
}

apps/contourclock/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ "id": "contourclock",
22
"name": "Contour Clock",
33
"shortName" : "Contour Clock",
4-
"version":"0.30",
4+
"version":"0.31",
55
"icon": "app.png",
66
"readme": "README.md",
77
"description": "A Minimalist clockface with large Digits.",

0 commit comments

Comments
 (0)