create first draft
parent
a385c09922
commit
03d18c61f4
13
apps.json
13
apps.json
|
|
@ -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"}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
0.1: First release.
|
||||
|
|
@ -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 |
Loading…
Reference in New Issue