mirror of https://github.com/espruino/BangleApps
added charging icon
parent
8ed8d91518
commit
1349e75cb3
|
@ -2,3 +2,4 @@
|
|||
0.02: Fix typo to Purple
|
||||
0.03: Added dependancy on Pedometer Widget
|
||||
0.04: Fixed icon and png to 48x48 pixels
|
||||
0.05: added charging icon
|
|
@ -2,7 +2,7 @@
|
|||
"id": "rebble",
|
||||
"name": "Rebble Clock",
|
||||
"shortName": "Rebble",
|
||||
"version": "0.04",
|
||||
"version": "0.05",
|
||||
"description": "A Pebble style clock, with configurable background, three sidebars including steps, day, date, sunrise, sunset, long live the rebellion",
|
||||
"readme": "README.md",
|
||||
"icon": "rebble.png",
|
||||
|
|
|
@ -204,6 +204,14 @@ function drawBattery(x,y,wi,hi) {
|
|||
g.setColor(g.theme.fg);
|
||||
g.fillRect(x+wi-3,y+2+(((hi - 1)/2)-1),x+wi-2,y+2+(((hi - 1)/2)-1)+4); // contact
|
||||
g.fillRect(x+3, y+5, x +4 + E.getBattery()*(wi-12)/100, y+hi-1); // the level
|
||||
|
||||
if( Bangle.isCharging() )
|
||||
{
|
||||
g.setBgColor(settings.bg);
|
||||
image = ()=> { return require("heatshrink").decompress(atob("j8OwMB/4AD94DC44DCwP//n/gH//EOgE/+AdBh/gAYMH4EAvkDAYP/+/AFAX+FgfzGAnAA=="));}
|
||||
g.drawImage(image(),x+3,y+4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getSteps() {
|
||||
|
@ -270,3 +278,14 @@ for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";}
|
|||
loadSettings();
|
||||
loadLocation();
|
||||
draw(); // queues the next draw for a minutes time
|
||||
Bangle.on('charging', function(charging) {
|
||||
//redraw the sidebar ( with the battery )
|
||||
switch(sideBar) {
|
||||
case 0:
|
||||
drawSideBar1();
|
||||
break;
|
||||
case 1:
|
||||
drawSideBar2();
|
||||
break;
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue