prepare first release
parent
1a320a56c7
commit
cf36400faa
|
|
@ -4680,7 +4680,7 @@
|
||||||
"name": "Charging Status",
|
"name": "Charging Status",
|
||||||
"shortName":"ChargingStatus",
|
"shortName":"ChargingStatus",
|
||||||
"icon": "widget.png",
|
"icon": "widget.png",
|
||||||
"version":"0.1.18",
|
"version":"0.1.0",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"description": "A simple widget that shows up whenever the watch starts charging.",
|
"description": "A simple widget that shows up whenever the watch starts charging.",
|
||||||
"tags": "widget",
|
"tags": "widget",
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
0.1: First release.
|
0.1.0: First release.
|
||||||
|
|
@ -1,30 +1,30 @@
|
||||||
(() => {
|
(() => {
|
||||||
Bangle.on('charging', (charging) => {
|
|
||||||
if (charging) {
|
|
||||||
Bangle.buzz();
|
|
||||||
}
|
|
||||||
Bangle.drawWidgets(); // re-layout widgets
|
|
||||||
g.flip();
|
|
||||||
});
|
|
||||||
|
|
||||||
const icon = require("heatshrink").decompress(atob("kEggIEBoAIC4ADFgIDCgYDDwADBg4DGh4DGj4DCn4DD/4gBv4DEBgP//4PBAYUB//+GQIDE/hDCAYf4AY3wAYXgAYxfHIYQDEOQUCAQI"));
|
const icon = require("heatshrink").decompress(atob("kEggIEBoAIC4ADFgIDCgYDDwADBg4DGh4DGj4DCn4DD/4gBv4DEBgP//4PBAYUB//+GQIDE/hDCAYf4AY3wAYXgAYxfHIYQDEOQUCAQI"));
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
g.reset();
|
g.reset();
|
||||||
|
if (Bangle.isCharging()) {
|
||||||
g.setColor("#FD0");
|
g.setColor("#FD0");
|
||||||
//if (Bangle.isCharging()) {
|
g.drawImage(icon, this.x, this.y + 1, {
|
||||||
g.drawImage(icon, this.x, this.y + 2, {
|
scale: 0.6875
|
||||||
scale: 0.8125
|
|
||||||
});
|
});
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WIDGETS.chargingStatus = {
|
WIDGETS.chargingStatus = {
|
||||||
area: 'tr',
|
area: 'tr',
|
||||||
width: 26,
|
width: 22,
|
||||||
draw: draw,
|
draw: draw,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Bangle.on('charging', (charging) => {
|
||||||
|
if (charging) {
|
||||||
|
Bangle.buzz();
|
||||||
|
WIDGETS.chargingStatus.width = 22;
|
||||||
|
} else {
|
||||||
|
WIDGETS.chargingStatus.width = 0;
|
||||||
|
}
|
||||||
|
Bangle.drawWidgets(); // re-layout widgets
|
||||||
|
g.flip();
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
Loading…
Reference in New Issue