Skip to content

Commit

Permalink
Move initialization into initialize function
Browse files Browse the repository at this point in the history
  • Loading branch information
whenlit committed Sep 6, 2024
1 parent 0219eeb commit 4bdf4a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion apps/dutchclock/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
0.14: Fix midnight
0.15: Fix midnight better
0.16: Fix midnight decisively
0.17: Get loadWidgets back in the right place
0.17: Get loadWidgets back in the right place
0.18: Move setUI and loadWidgets to initialize function
11 changes: 5 additions & 6 deletions apps/dutchclock/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ const Y = SCREEN_HEIGHT / 2
let date, mins;

function initialize() {
// Tell Bangle this is a clock
Bangle.setUI("clock");
// Load widgets
Bangle.loadWidgets();

// draw immediately at first
tick();

Expand Down Expand Up @@ -101,12 +106,6 @@ function draw() {
g.drawString(bottomLines.join('\n'), SCREEN_WIDTH/2, SCREEN_HEIGHT - BOTTOM_SPACING, false);
}

/* Show launcher when middle button pressed
This should be done *before* Bangle.loadWidgets so that
widgets know if they're being loaded into a clock app or not */
Bangle.setUI("clock");
// Load widgets
Bangle.loadWidgets();

if (settings.showWidgets) {
Bangle.drawWidgets();
Expand Down
2 changes: 1 addition & 1 deletion apps/dutchclock/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Dutch Clock",
"shortName":"Dutch Clock",
"icon": "app.png",
"version":"0.17",
"version":"0.18",
"description": "A clock that displays the time the way a Dutch person would respond when asked what time it is.",
"type": "clock",
"tags": "clock,dutch,text",
Expand Down

0 comments on commit 4bdf4a0

Please sign in to comment.