forked from FOSS/BangleApps
Merge branch 'espruino:master' into master
commit
81d7720826
|
@ -5,7 +5,7 @@
|
|||
"version": "0.08",
|
||||
"description": "Read BLE enabled cycling speed and cadence sensor and display readings on watch",
|
||||
"icon": "icons8-cycling-48.png",
|
||||
"tags": "outdoors,exercise,ble,bluetooth",
|
||||
"tags": "outdoors,exercise,ble,bluetooth,bike,cycle,bicycle",
|
||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||
"readme": "README.md",
|
||||
"storage": [
|
||||
|
|
|
@ -15,10 +15,11 @@ You can record
|
|||
|
||||
* **Time** The current time
|
||||
* **GPS** GPS Latitude, Longitude and Altitude
|
||||
* **Steps** Steps counted by the step counter
|
||||
* **HR** Heart rate and confidence
|
||||
* **BAT** Battery percentage and voltage
|
||||
* **Core** CoreTemp body temperature
|
||||
* **Steps** Steps counted by the step counter
|
||||
* **Baro** (Bangle.js 2) Using the built-in barometer to record Temperature, Pressure and Altitude
|
||||
* **Core** CoreTemp body temperature *if* you have a CoreTemp device and the https://banglejs.com/apps/?id=coretemp app installed
|
||||
|
||||
You can then start/stop recording from the Recorder app itself (and as long as widgets are
|
||||
enabled in the app you're using, you can move to another app and continue recording).
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
0.01: New Widget!
|
|
@ -0,0 +1,13 @@
|
|||
{ "id": "widclkinfo",
|
||||
"name": "Clock Info Widget",
|
||||
"version":"0.01",
|
||||
"description": "Use 'Clock Info' in the Widget bar. Tap on the widget to select, then drag up/down/left/right to choose what information is displayed.",
|
||||
"icon": "widget.png",
|
||||
"screenshots" : [ { "url":"screenshot.png" }],
|
||||
"type": "widget",
|
||||
"tags": "widget,clkinfo",
|
||||
"supports" : ["BANGLEJS2"],
|
||||
"storage": [
|
||||
{"name":"widclkinfo.wid.js","url":"widget.js"}
|
||||
]
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
|
@ -0,0 +1,49 @@
|
|||
if (!require("clock_info").loadCount) { // don't load if a clock_info was already loaded
|
||||
// Load the clock infos
|
||||
let clockInfoItems = require("clock_info").load();
|
||||
// Add the
|
||||
let clockInfoMenu = require("clock_info").addInteractive(clockInfoItems, {
|
||||
// Add the dimensions we're rendering to here - these are used to detect taps on the clock info area
|
||||
x : 0, y: 0, w: 72, h:24,
|
||||
// You can add other information here you want to be passed into 'options' in 'draw'
|
||||
// This function draws the info
|
||||
draw : (itm, info, options) => {
|
||||
// itm: the item containing name/hasRange/etc
|
||||
// info: data returned from itm.get() containing text/img/etc
|
||||
// options: options passed into addInteractive
|
||||
clockInfoInfo = info;
|
||||
if (WIDGETS["clkinfo"])
|
||||
WIDGETS["clkinfo"].draw(WIDGETS["clkinfo"]);
|
||||
}
|
||||
});
|
||||
let clockInfoInfo; // when clockInfoMenu.draw is called we set this up
|
||||
|
||||
// The actual widget we're displaying
|
||||
WIDGETS["clkinfo"] = {
|
||||
area:"tl",
|
||||
width: clockInfoMenu.w,
|
||||
draw:function(e) {
|
||||
clockInfoMenu.x = e.x;
|
||||
clockInfoMenu.y = e.y;
|
||||
var o = clockInfoMenu;
|
||||
// Clear the background
|
||||
g.reset();
|
||||
// indicate focus - make background reddish
|
||||
//if (clockInfoMenu.focus) g.setBgColor(g.blendColor(g.theme.bg, "#f00", 0.25));
|
||||
if (clockInfoMenu.focus) g.setColor("#f00");
|
||||
g.clearRect(o.x, o.y, o.x+o.w-1, o.y+o.h);
|
||||
if (clockInfoInfo) {
|
||||
var x = o.x;
|
||||
if (clockInfoInfo.img) {
|
||||
g.drawImage(clockInfoInfo.img, x,o.y); // draw the image
|
||||
x+=24;
|
||||
}
|
||||
var availableWidth = o.x+clockInfoMenu.w - (x+2);
|
||||
g.setFont("6x8:2").setFontAlign(-1,0);
|
||||
if (g.stringWidth(clockInfoInfo.text) > availableWidth)
|
||||
g.setFont("6x8");
|
||||
g.drawString(clockInfoInfo.text, x+2,o.y+12); // draw the text
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
|
@ -88,7 +88,7 @@ exports.swipeOn = function(autohide) {
|
|||
}
|
||||
|
||||
for (var w of global.WIDGETS) {
|
||||
if (w._draw) return; // already hidden
|
||||
if (w._draw) continue; // already hidden
|
||||
w._draw = w.draw;
|
||||
w.draw = function() {
|
||||
g=og;
|
||||
|
|
Loading…
Reference in New Issue