BangleApps/apps/widChargingStatus/widget.js

30 lines
555 B
JavaScript
Raw Normal View History

(() => {
Bangle.on('charging', (charging) => {
if (charging) {
Bangle.buzz();
}
Bangle.drawWidgets(); // re-layout widgets
g.flip();
});
2021-12-04 21:26:55 +00:00
const icon = require("heatshrink").decompress(atob("kEggIEBoAIC4ADFgIDCgYDDwADBg4DGh4DGj4DCn4DD/4gBv4DEBgP//4PBAYUB//+GQIDE/hDCAYf4AY3wAYXgAYxfHIYQDEOQUCAQI"));
2021-12-04 21:22:22 +00:00
function draw() {
g.reset();
2021-12-04 21:22:22 +00:00
g.setColor("#FD0");
//if (Bangle.isCharging()) {
2021-12-04 21:30:02 +00:00
g.drawImage(icon, this.x, this.y + 2, {
scale: 0.8125
});
//}
}
WIDGETS.chargingStatus = {
area: 'tr',
2021-12-04 21:30:02 +00:00
width: 26,
draw: draw,
};
})();