mirror of https://github.com/espruino/BangleApps
add GPS speed clockinfo
parent
83e32cd75d
commit
3eb1f8ff6b
|
@ -0,0 +1 @@
|
|||
0.01: New Clock Info!
|
|
@ -0,0 +1,27 @@
|
|||
(function() {
|
||||
var speed;
|
||||
function gpsHandler(e) {
|
||||
speed = e.speed;
|
||||
ci.items[0].emit('redraw');
|
||||
}
|
||||
var ci = {
|
||||
name: "GPS",
|
||||
items: [
|
||||
{ name : "Speed",
|
||||
get : function() { return { text : isFinite(speed) ? require("locale").speed(speed) : "--",
|
||||
v : 0, min : isFinite(speed) ? speed : 0, max : 150,
|
||||
img : atob("GBiBAAAAAAAAAAAAAAAAAAD/AAHDgAMYwAbDYAwAMAoA0BgDmBgfGB4ceBgYGBgAGBoAWAwAMAwAMAf/4AP/wAAAAAAAAAAAAAAAAA==") }},
|
||||
show : function() {
|
||||
Bangle.setGPSPower(1, "clkinfogpsspeed");
|
||||
Bangle.on("GPS", gpsHandler);
|
||||
},
|
||||
hide : function() {
|
||||
Bangle.removeListener("GPS", gpsHandler);
|
||||
Bangle.setGPSPower(0, "clkinfogpsspeed");
|
||||
}
|
||||
// run : function() {} optional (called when tapped)
|
||||
}
|
||||
]
|
||||
};
|
||||
return ci;
|
||||
}) // must not have a semi-colon!
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,13 @@
|
|||
{ "id": "clkinfogpsspeed",
|
||||
"name": "GPS Speed Clockinfo",
|
||||
"shortName":"GPS Speed",
|
||||
"version":"0.01",
|
||||
"description": "A Clockinfo that displays your current speed according to the GPS",
|
||||
"icon": "icon.png",
|
||||
"type": "clkinfo",
|
||||
"tags": "clkinfo",
|
||||
"supports" : ["BANGLEJS2"],
|
||||
"storage": [
|
||||
{"name":"clkinfogpsspeed.clkinfo.js","url":"clkinfo.js"}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue