diff --git a/apps.json b/apps.json index f046debd7..765a38e5c 100644 --- a/apps.json +++ b/apps.json @@ -4716,6 +4716,22 @@ {"name":"pooqroman.json"} ] }, + { + "id": "widbata", + "name": "Battery Level Widget (Themed)", + "shortName":"Battery Theme", + "icon": "widbata.png", + "screenshots": [{"url":"screenshot_widbata_1.png"}], + "version":"0.01", + "type": "widget", + "supports": ["BANGLEJS2"], + "readme": "README.md", + "description": "Shows the current battery level status in the top right using the clocks colour theme", + "tags": "widget,battery", + "storage": [ + {"name":"widbata.wid.js","url":"widbata.wid.js"} + ] + }, { "id": "weatherClock", "name": "Weather Clock", diff --git a/apps/widbata/ChangeLog b/apps/widbata/ChangeLog new file mode 100644 index 000000000..51575d3b4 --- /dev/null +++ b/apps/widbata/ChangeLog @@ -0,0 +1 @@ +0.01: Created diff --git a/apps/widbata/README.md b/apps/widbata/README.md new file mode 100644 index 000000000..6c3012793 --- /dev/null +++ b/apps/widbata/README.md @@ -0,0 +1,14 @@ +# Battery Level Widget (Themed) + +Shows the current battery level status in the top right using the clocks colour theme + +* Works with Bangle 2 +* Simple design, no settings +* 27 pixels wide +* Uses current colour theme to match clock + +![](screenshot_widbata_1.png) +![](screenshot_widbata_2.png) +![](screenshot_widbata_3.png) + +Written by: [Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS Forum](http://forum.espruino.com/microcosms/1424/) diff --git a/apps/widbata/screenshot_widbata_1.png b/apps/widbata/screenshot_widbata_1.png new file mode 100644 index 000000000..5fdc3ac3d Binary files /dev/null and b/apps/widbata/screenshot_widbata_1.png differ diff --git a/apps/widbata/screenshot_widbata_2.png b/apps/widbata/screenshot_widbata_2.png new file mode 100644 index 000000000..6a6ec8581 Binary files /dev/null and b/apps/widbata/screenshot_widbata_2.png differ diff --git a/apps/widbata/screenshot_widbata_3.png b/apps/widbata/screenshot_widbata_3.png new file mode 100644 index 000000000..824309702 Binary files /dev/null and b/apps/widbata/screenshot_widbata_3.png differ diff --git a/apps/widbata/widbata.png b/apps/widbata/widbata.png new file mode 100644 index 000000000..877af1707 Binary files /dev/null and b/apps/widbata/widbata.png differ diff --git a/apps/widbata/widbata.wid.js b/apps/widbata/widbata.wid.js new file mode 100644 index 000000000..1c04bf8ae --- /dev/null +++ b/apps/widbata/widbata.wid.js @@ -0,0 +1,16 @@ +setInterval(()=>WIDGETS["bata"].draw(), 60000); +Bangle.on('lcdPower', function(on) { + if (on) WIDGETS["bata"].draw(); +}); +WIDGETS["bata"]={area:"tr",width:27,draw:function() { + var s = 26; + var t = 13; // thickness + var x = this.x, y = this.y; + g.reset(); + g.setColor(g.theme.fg); + g.fillRect(x,y+2,x+s-4,y+2+t); // outer + g.clearRect(x+2,y+2+2,x+s-4-2,y+2+t-2); // centre + g.setColor(g.theme.fg); + g.fillRect(x+s-3,y+2+(((t - 1)/2)-1),x+s-2,y+2+(((t - 1)/2)-1)+4); // contact + g.fillRect(x+3, y+5, x +4 + E.getBattery()*(s-12)/100, y+t-1); // the level +}};