From 706a97a7b62bbe79560a3b9cf1d94dd407406cba Mon Sep 17 00:00:00 2001 From: MaBecker Date: Tue, 31 Mar 2020 20:22:56 +0200 Subject: [PATCH 1/3] app widget tiniy battery --- apps.json | 11 +++++++++++ apps/widtbat/ChangeLog | 1 + apps/widtbat/widget.js | 18 ++++++++++++++++++ apps/widtbat/widget.png | Bin 0 -> 911 bytes 4 files changed, 30 insertions(+) create mode 100644 apps/widtbat/ChangeLog create mode 100644 apps/widtbat/widget.js create mode 100644 apps/widtbat/widget.png diff --git a/apps.json b/apps.json index 9bef19fef7..7fc272235b 100644 --- a/apps.json +++ b/apps.json @@ -888,5 +888,16 @@ {"name":"barclock.app.js","url":"clock-bar.js"}, {"name":"barclock.img","url":"clock-bar-icon.js","evaluate":true} ] + }, + { "id": "widtbat", + "name": "Tiny Battery Widget", + "icon": "widget.png", + "version":"0.01", + "description": "Tiny blueish battery widget, vibs and changes level coler when charging", + "tags": "widget,tool,system", + "type":"widget", + "storage": [ + {"name":"widtbat.wid.js","url":"widget.js"} + ] } ] diff --git a/apps/widtbat/ChangeLog b/apps/widtbat/ChangeLog new file mode 100644 index 0000000000..79c4b410dd --- /dev/null +++ b/apps/widtbat/ChangeLog @@ -0,0 +1 @@ +001 New widget diff --git a/apps/widtbat/widget.js b/apps/widtbat/widget.js new file mode 100644 index 0000000000..f60034300b --- /dev/null +++ b/apps/widtbat/widget.js @@ -0,0 +1,18 @@ +/* jshint esversion: 6 */ +(() => { + const CBS = 0x41f, CBC = 0x07E0; + var batS = require("heatshrink").decompress(atob("j0TwIHEv///kD////EfAYPwuEAgPB4EAg/HCgMfzgDBvwOC/IOC84ONDoUcFgc/AYOAHYRDE")); + var xo = 6, xl = 22, yo = 9, h = 17; + + function draw() { + g.reset().setColor(CBS).drawImage(batS, this.x + 1, this.y + 4); + g.setColor(0).fillRect(this.x + xo, this.y + yo, this.x + xl, this.y + h); + var cbc = (Bangle.isCharging()) ? CBC : CBS; + g.setColor(cbc).fillRect(this.x + xo, this.y + yo, this.x + (xl - xo) / 100 * E.getBattery() + xo, this.y + h); + } + Bangle.on('charging', function(charging) { + if (charging) Bangle.buzz(); + Bangle.drawWidgets(); + }); + WIDGETS["widtbat"] = { area:"tr", width:32, draw: draw }; +})(); diff --git a/apps/widtbat/widget.png b/apps/widtbat/widget.png new file mode 100644 index 0000000000000000000000000000000000000000..4294f0ca32299687f44c631a14109629f857f4a1 GIT binary patch literal 911 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC#^NA%Cx&(BWL^R}0jUw5X}-P; zT0k}j0~4bV12aeo5Hhr9GO&Qz3=C>Ont_3N0V6_o0TW!-U;#6N4N`dWm6H(AkjTuC zh>{3jAFJg2T)o7U{G?R9irfN_0tTB3D*7iAWdWaj57fXq!y$}cUk zRZ;?31P2gzmSmu1yMhW`HkzTTSoaJ~2f8+kKR6OrFMCe`Z3#?B8 zC49*z`DeL<{|n(yEW*2#>kN&)@-iK7o}>EZyS}siuHP4aO2{#|b+YeT#Q0>l@TS?U z-Aq$V>eZY@m1ibibT(C-EV=!^vgEPuBgal1dB(`on$ebYVzQRQSqH^a%uB2$%z8DE z>HW$2WB(=7FJIlJG`oKy`vg^X$>_F+_K$r^%z0J$4H%3Uf0^)&Vb^2FKZ>Hvi{%c8 zF){0!&1!K=Za5?$k>$y;xZYrj&4(F{orb)&huCVPI|2^(Yw!ygvDk*ZIC=b8qrU_D zf!{11YaOe0ai@u|sP7R^IL*BK!>a|WRUYR#T}!NZa6kT-*Meo`Ehd*7|H&FNC$lP6 z8`u=+ML*@cApFdsH@o47vLbVa!hgXV%VUoI`al2PNuH;-O$_R Date: Tue, 31 Mar 2020 20:37:10 +0200 Subject: [PATCH 2/3] app widget tiniy battery --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 7fc272235b..be3ac925ea 100644 --- a/apps.json +++ b/apps.json @@ -893,7 +893,7 @@ "name": "Tiny Battery Widget", "icon": "widget.png", "version":"0.01", - "description": "Tiny blueish battery widget, vibs and changes level coler when charging", + "description": "Tiny blueish battery widget, vibs and changes level color when charging", "tags": "widget,tool,system", "type":"widget", "storage": [ From 253382bfe1b825b1b933f91331750d002b8a39bb Mon Sep 17 00:00:00 2001 From: MaBecker Date: Wed, 1 Apr 2020 09:38:41 +0200 Subject: [PATCH 3/3] app widget tiniy battery --- apps/widtbat/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/widtbat/ChangeLog b/apps/widtbat/ChangeLog index 79c4b410dd..4c21f3ace3 100644 --- a/apps/widtbat/ChangeLog +++ b/apps/widtbat/ChangeLog @@ -1 +1 @@ -001 New widget +0.01: New Widget!