widhwt: Ported to Bangle.js2
Tactically all that was needed was to state that it works with Bangle.js2. However the swipe gesture interfered with using the menu on Bangle.js2. So it has been deactivated and we recommend using Pattern Launcher instead.master
parent
d3ccc08209
commit
87f0ffcd96
|
|
@ -1889,12 +1889,13 @@
|
|||
{
|
||||
"id": "widhwt",
|
||||
"name": "Hand Wash Timer",
|
||||
"version": "0.01",
|
||||
"description": "Swipe your wrist over the watch face to start your personal Bangle.js hand wash timer for 35 sec. Start washing after the short buzz and stop after the long buzz.",
|
||||
"version": "0.02-rc6",
|
||||
"description": "On Bangle.js 1 swipe your wrist over the watch face to start your personal Bangle.js 1 hand wash timer. On Bangle.js2 the Pattern Launcher is recommended to start the timer. Start washing after the short buzz and stop after the long buzz 35sec. later.",
|
||||
"icon": "widget.png",
|
||||
"type": "widget",
|
||||
"tags": "widget,tool",
|
||||
"supports": ["BANGLEJS"],
|
||||
"allow_emulator": true,
|
||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||
"storage": [
|
||||
{"name":"widhwt.wid.js","url":"widget.js"}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
0.01: New Widget!
|
||||
0.02: Ported to Bangle.js2
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
// Replace the "Loading..." box
|
||||
// with our own message
|
||||
g.clearRect(38, 68, 138, 108);
|
||||
g.drawRect(38, 68, 138, 108);
|
||||
g.setFontVector(13).drawString("Wash...", 60, 82);
|
||||
|
||||
Bangle.buzz();
|
||||
setTimeout(() => {
|
||||
Bangle.buzz(1E3, 1);
|
||||
setTimeout(() => load(), 2E3);
|
||||
}, 35E3);
|
||||
|
|
@ -6,9 +6,7 @@
|
|||
g.reset().setColor(color).drawImage(require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA==")), this.x + 1, 0);
|
||||
}
|
||||
|
||||
WIDGETS["widhwt"] = { area: "tr", width: 26, draw: draw };
|
||||
|
||||
Bangle.on('swipe', function() {
|
||||
function startTimer() {
|
||||
color = 0x41f;
|
||||
Bangle.buzz();
|
||||
Bangle.drawWidgets();
|
||||
|
|
@ -17,6 +15,14 @@
|
|||
Bangle.buzz(1E3, 1);
|
||||
Bangle.drawWidgets();
|
||||
}, 35E3);
|
||||
}
|
||||
|
||||
});
|
||||
if (process.env.HWVERSION == 1) {
|
||||
WIDGETS["widhwt"] = {
|
||||
area: "tr",
|
||||
width: 26,
|
||||
draw: draw,
|
||||
};
|
||||
Bangle.on('swipe', startTimer);
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in New Issue