create first draft

master
Sebastian Di Luzio 2021-12-04 19:25:50 +01:00
parent a385c09922
commit 03d18c61f4
4 changed files with 37 additions and 0 deletions

View File

@ -4675,5 +4675,18 @@
"data": [
{"name":"pooqroman.json"}
]
},
{ "id": "chargingStatus",
"name": "Charging Status",
"shortName":"Charging",
"icon": "widget.png",
"version":"0.1",
"type": "widget",
"description": "A simple widget that shows up whenever the watch starts charging.",
"tags": "widget,battery",
"supports": ["BANGLEJS","BANGLEJS2"],
"storage": [
{"name":"chargingStatus.wid.js","url":"widget.js"}
]
}
]

View File

@ -0,0 +1 @@
0.1: First release.

View File

@ -0,0 +1,23 @@
(() => {
Bangle.on('charging', (charging) => {
if (charging) {
Bangle.buzz();
}
Bangle.drawWidgets(); // re-layout widgets
g.flip();
});
WIDGETS.chargingStatus = {
area: 'tr',
width: 16,
draw() {
const {
x,
y
} = this;
g.reset();
if (Bangle.isCharging()) {
g.setColor('#0f0').drawImage(atob("EBCBAf9//3/+f/x//P/4//gH8A/wD+Af/x//P/4//n/+//7/"), x, y);
}
},
};
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB