1
0
Fork 0

Merge pull request #112 from MaBecker/widget_id

New widget  widid
master
Gordon Williams 2020-03-05 08:25:15 +00:00 committed by GitHub
commit 1323bd2bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 0 deletions

View File

@ -800,5 +800,16 @@
{"name":"torch.wid.js","url":"widget.js"},
{"name":"torch.img","url":"app-icon.js","evaluate":true}
]
},
{ "id": "widid",
"name": "My NRF ID Widget",
"icon": "widid.png",
"version":"0.01",
"description": "Display the last two tuple of your Bangle.js address in the widget section.",
"tags": "widget",
"type":"widget",
"storage": [
{"name":"widid.wid.js","url":"widget.js"}
]
}
]

1
apps/widid/ChangeLog Normal file
View File

@ -0,0 +1 @@
0.01: New Widget!

16
apps/widid/widget.js Normal file
View File

@ -0,0 +1,16 @@
/* jshint esversion: 6 */
(() => {
var xpos = WIDGETPOS.tr - 16;
WIDGETPOS.tr -= 16;
id = NRF.getAddress().split(":");
// draw your widget at xpos
function draw() {
var x = xpos,
y = 0;
g.setColor(0, 0.5, 1).setFont("6x8", 1);
g.drawString(id[4], x, 0, true);
g.drawString(id[5], x, 10, true);
}
WIDGETS["widid"] = { draw: draw };
})();

BIN
apps/widid/widget.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB