From a98a6015b1c381476901aae9abb89370034c243b Mon Sep 17 00:00:00 2001 From: hughbarney Date: Wed, 12 Jan 2022 22:45:42 +0000 Subject: [PATCH] Simple Pedometer and Lato Pedometer widgets --- apps.json | 32 ++++++++++++++++++++++++++++++++ apps/widpa/README.md | 16 ++++++++++++++++ apps/widpa/screenshot_widpa.png | Bin 0 -> 246 bytes apps/widpa/widpa.wid.js | 17 +++++++++++++++++ apps/widpb/README.md | 17 +++++++++++++++++ apps/widpb/screenshot_widpb.png | Bin 0 -> 338 bytes apps/widpb/widpb.wid.js | 20 ++++++++++++++++++++ 7 files changed, 102 insertions(+) create mode 100644 apps/widpa/README.md create mode 100644 apps/widpa/screenshot_widpa.png create mode 100644 apps/widpa/widpa.wid.js create mode 100644 apps/widpb/README.md create mode 100644 apps/widpb/screenshot_widpb.png create mode 100644 apps/widpb/widpb.wid.js diff --git a/apps.json b/apps.json index 4c6f3bdcf..56ddbed2d 100644 --- a/apps.json +++ b/apps.json @@ -5577,5 +5577,37 @@ "data": [ {"name":"banglexercise.json"} ] + }, + { + "id": "widpa", + "name": "Simple Pedometer", + "shortName":"Simple Pedometer", + "icon": "screenshot_widpa.png", + "screenshots": [{"url":"screenshot_widpa.png"}], + "version":"0.01", + "type": "widget", + "supports": ["BANGLEJS", "BANGLEJS2"], + "readme": "README.md", + "description": "Displays the current step count from `Bangle.getHealthStatus(\"day\").steps` in 12x16 font, requires firmware v2.11.21 or later", + "tags": "widget,battery", + "storage": [ + {"name":"widpa.wid.js","url":"widpa.wid.js"} + ] + }, + { + "id": "widpb", + "name": "Lato Pedometer", + "shortName":"Lato Pedometer", + "icon": "screenshot_widpb.png", + "screenshots": [{"url":"screenshot_widpb.png"}], + "version":"0.01", + "type": "widget", + "supports": ["BANGLEJS", "BANGLEJS2"], + "readme": "README.md", + "description": "Displays the current step count from `Bangle.getHealthStatus(\"day\").steps` in the Lato font, requires firmware v2.11.21 or later", + "tags": "widget,battery", + "storage": [ + {"name":"widpb.wid.js","url":"widpb.wid.js"} + ] } ] diff --git a/apps/widpa/README.md b/apps/widpa/README.md new file mode 100644 index 000000000..92fbb8c11 --- /dev/null +++ b/apps/widpa/README.md @@ -0,0 +1,16 @@ +# Simple Pedometer Widget + +*Displays the current step count from `Bangle.getHealthStatus("day").steps` in (6x8,2) font, Requires firmware v2.11.21 or later* + +* Designed to be small, minimal, does one thing well, no settings +* Supports Bangle 1 and Bangle 2 + +## Notes + +* Requires firmware v2.11.21 or later +* `Bangle.getHealthStatus("day").steps` is reset to zero if you reboot your watch with a long BTN Press +* The step count displayed may be a few steps more than that reported by widpedpm as widpedom may not always be loaded. + +![](screenshot_widpa.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/widpa/screenshot_widpa.png b/apps/widpa/screenshot_widpa.png new file mode 100644 index 0000000000000000000000000000000000000000..e33550f50d6376cdec0f5faeaaec87a548e979f3 GIT binary patch literal 246 zcmVPx#ut`KgR9HvtR?!ZCAPAKI|7hFVXv)Gv%MBU5LKnv!1l3w=IsBm{;Y7hy!if+i zt`bDlHCbC=GLK*SD_<(j-;?;SN*ql>V`}XP=SdudYmIA4cS;~Itw=-?;acNE5}LPn zd3@HcJOjg-2t@*I71R-{-B#^qQX)w-?ftr)kiF%s-rLE#9ainMijU5kr=Io{-~9)k w#YeOA%wRYYNItLexL2&#j%#(L5?&O$01ECQ%Y=MG this.width) {this.width = w; setTimeout(() => Bangle.drawWidgets(),10); return;} + g.reset(); + g.setColor(g.theme.bg); + g.fillRect(this.x, this.y, this.x + this.width, this.y + 23); + g.setColor(g.theme.fg); + g.setFont('6x8',2); + g.setFontAlign(-1, 0); + g.drawString(steps, this.x, this.y + 12); +}}; diff --git a/apps/widpb/README.md b/apps/widpb/README.md new file mode 100644 index 000000000..bec127b6b --- /dev/null +++ b/apps/widpb/README.md @@ -0,0 +1,17 @@ +# Lato Pedometer Widget + +*Displays the current step count from `Bangle.getHealthStatus("day").steps` in the Lato font, Requires firmware v2.11.21 or later* + +* Designed to be minimal, does one thing well, no settings +* Supports Bangle 1 and Bangle 2 + +## Notes + +* Requires firmware v2.11.21 or later +* Uses the Lato custom font, so memory footprint is 500 bytes larger than 'Simple Pedometer Widget' +* `Bangle.getHealthStatus("day").steps` is reset to zero if you reboot your watch with a long BTN Press +* The step count displayed may be a few steps more than that reported by widpedpm as widpedom may not always be loaded. + +![](screenshot_widpb.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/widpb/screenshot_widpb.png b/apps/widpb/screenshot_widpb.png new file mode 100644 index 0000000000000000000000000000000000000000..af1222e7e8663af2945d6f4c2978cad7a4cac5b8 GIT binary patch literal 338 zcmV-Y0j>UtP)Px$3`s;mR9HvtSkVrIAPhVH|D!RO!{FR#y9Yyvz8N=Y*KTlEYOVFR!BajWi>bK3 zBBhk8=207sF{40i+cA6eb$e`xCF&8hNkpP=jL6vhSvZDZ(xStFt2!bhkuB zk)~GG^WKS!M)1QD!3{x;yRIn6%d>;et2%04rqT+g+g&SrF0c*j5uRBqO$7OQ this.width) {this.width = w; setTimeout(() => Bangle.drawWidgets(),10); return;} + g.reset(); + g.setColor(g.theme.bg); + g.fillRect(this.x, this.y, this.x + this.width, this.y + 23); // erase background + g.setColor(g.theme.fg); + // Lato from fonts.google.com, Actual height 17 (17 - 1), Numeric only + const scale = 1; + g.setFontCustom(atob("AAAAABwAAOAAAgAAHAADwAD4AB8AB8AA+AAeAADAAAAOAAP+AH/8B4DwMAGBgAwMAGBgAwOAOA//gD/4AD4AAAAAAAABgAAcAwDAGAwAwP/+B//wAAGAAAwAAGAAAAAAAAIAwHgOA4DwMA+BgOwMDmBg4wOeGA/gwDwGAAAAAAAAAGAHA8A4DwMAGBhAwMMGBjgwOcOA+/gDj4AAAAABgAAcAAHgADsAA5gAOMAHBgBwMAP/+B//wABgAAMAAAAAAAgD4OB/AwOYGBjAwMYGBjBwMe8Bh/AIHwAAAAAAAAAfAAP8AHxwB8GAdgwPMGBxgwMOOAB/gAH4AAAAAAABgAAMAABgAwMAeBgPgMHwBj4AN8AB+AAPAABAAAAAAAMfAH38B/xwMcGBhgwMMGBjgwP+OA+/gDj4AAAAAAAAOAAH4AA/gQMMGBgzwME8BhvAOPgA/4AD8AAEAAAAAAGAwA4OAHBwAAA="), 46, atob("BAgMDAwMDAwMDAwMBQ=="), 21+(scale<<8)+(1<<16)); + g.setFontAlign(-1, 0); + g.drawString(steps, this.x, this.y + 12); +}};