diff --git a/apps.json b/apps.json index a312b90a3..af5921669 100644 --- a/apps.json +++ b/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"} + ] } ] diff --git a/apps/chargingStatus/ChangeLog b/apps/chargingStatus/ChangeLog new file mode 100644 index 000000000..d3175e1ab --- /dev/null +++ b/apps/chargingStatus/ChangeLog @@ -0,0 +1 @@ +0.1: First release. \ No newline at end of file diff --git a/apps/chargingStatus/widget.js b/apps/chargingStatus/widget.js new file mode 100644 index 000000000..72e8bdb26 --- /dev/null +++ b/apps/chargingStatus/widget.js @@ -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); + } + }, + }; +})(); \ No newline at end of file diff --git a/apps/chargingStatus/widget.png b/apps/chargingStatus/widget.png new file mode 100644 index 000000000..0097d45ef Binary files /dev/null and b/apps/chargingStatus/widget.png differ