add clkinfodist
parent
74600dde8e
commit
0cf8d53c52
|
|
@ -5,7 +5,7 @@
|
|||
"icon": "app.png",
|
||||
"screenshots": [{"url":"screenshot.png"}],
|
||||
"type": "clkinfo",
|
||||
"tags": "clkinfo",
|
||||
"tags": "clkinfo,clock",
|
||||
"supports" : ["BANGLEJS2"],
|
||||
"storage": [
|
||||
{"name":"clkinfoclk.clkinfo.js","url":"clkinfo.js"}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
0.01: New App!
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
|
|
@ -0,0 +1,22 @@
|
|||
(function() {
|
||||
let strideLength = (require("Storage").readJSON("myprofile.json",1)||{}).strideLength ?? 0.79,
|
||||
lastSteps = 0;
|
||||
function stepUpdateHandler() { distance.emit("redraw"); }
|
||||
var distance = {
|
||||
name : "Distance",
|
||||
get : () => { let v = (Bangle.getHealthStatus("day").steps - lastSteps)*strideLength; return {
|
||||
text : require("locale").distance(v,1),
|
||||
img : atob("GBiBAAMAAAeAAA/AAA/AAA/gAA/gwAfh4AfD4APD4AOH4AAH4ADj4AHjwAHhwADgAAACAAAHgAAPAAAHAAgCEBgAGD///BgAGAgAEA==")
|
||||
};},
|
||||
run : function() {
|
||||
lastSteps = (lastSteps>=Bangle.getHealthStatus("day").steps) ? 0 : Bangle.getHealthStatus("day").steps;
|
||||
this.emit("redraw");
|
||||
},
|
||||
show : function() { Bangle.on("step", stepUpdateHandler); stepUpdateHandler(); },
|
||||
hide : function() { Bangle.removeListener("step", stepUpdateHandler); }
|
||||
};
|
||||
return {
|
||||
name: "Bangle",
|
||||
items: [ distance ]
|
||||
};
|
||||
})
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
|
|
@ -0,0 +1,14 @@
|
|||
{ "id": "clkinfodist",
|
||||
"name": "Clockinfo Distance",
|
||||
"version":"0.01",
|
||||
"description": "Uses the 'My Profile' app's Stride Length to calculate distance travelled based on step count. Tap to reset for measuring distances.",
|
||||
"icon": "app.png",
|
||||
"screenshots": [{"url":"screenshot.png"}],
|
||||
"type": "clkinfo",
|
||||
"tags": "clkinfo,distance,steps,outdoors,tool",
|
||||
"dependencies": {"myprofile":"app"},
|
||||
"supports" : ["BANGLEJS2"],
|
||||
"storage": [
|
||||
{"name":"clkinfodist.clkinfo.js","url":"clkinfo.js"}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Loading…
Reference in New Issue