Merge pull request #1295 from hughbarney/master

Simple, Lato Pedometer - resize on step count reset. Widlock: set sortorder -1 in apps.json
master
Gordon Williams 2022-01-14 09:08:15 +00:00 committed by GitHub
commit b9d3bc8c8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 7 deletions

View File

@ -942,12 +942,13 @@
{
"id": "widlock",
"name": "Lock Widget",
"version": "0.03",
"version": "0.04",
"description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked",
"icon": "widget.png",
"type": "widget",
"tags": "widget,lock",
"supports": ["BANGLEJS","BANGLEJS2"],
"sortorder": -1,
"storage": [
{"name":"widlock.wid.js","url":"widget.js"}
]
@ -5618,7 +5619,7 @@
"shortName":"Simple Pedometer",
"icon": "screenshot_widpa.png",
"screenshots": [{"url":"screenshot_widpa.png"}],
"version":"0.01",
"version":"0.02",
"type": "widget",
"supports": ["BANGLEJS", "BANGLEJS2"],
"readme": "README.md",
@ -5634,7 +5635,7 @@
"shortName":"Lato Pedometer",
"icon": "screenshot_widpb.png",
"screenshots": [{"url":"screenshot_widpb.png"}],
"version":"0.01",
"version":"0.02",
"type": "widget",
"supports": ["BANGLEJS", "BANGLEJS2"],
"readme": "README.md",

View File

@ -1,3 +1,4 @@
0.01: First commit
0.02: Handle new firmwares with 'lock' event
0.03: Don't try to be fancy - just bail out on firmwares without a lock event
0.04: Set sortorder to -1 so that widget always takes up the furthest left position

View File

@ -1 +1,2 @@
0.01: First release
0.02: Size widget after step count is reset

View File

@ -6,7 +6,7 @@ WIDGETS["widpa"]={area:"tl",width:13,draw:function() {
if (!Bangle.isLCDOn()) return; // dont redraw if LCD is off
var steps = Bangle.getHealthStatus("day").steps;
var w = 1 + (steps.toString().length)*12;
if (w > this.width) {this.width = w; setTimeout(() => Bangle.drawWidgets(),10); return;}
if (w != 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);

View File

@ -1 +1,2 @@
0.01: First release
0.02: Fixed widget id to wibpb, Size widget after step count is reset

View File

@ -1,13 +1,13 @@
// on.step version
Bangle.on('step', function(s) { WIDGETS["bata"].draw(); });
Bangle.on('lcdPower', function(on) {
if (on) WIDGETS["bata"].draw();
if (on) WIDGETS["widpb"].draw();
});
WIDGETS["bata"]={area:"tl",width:13,draw:function() {
WIDGETS["widpb"]={area:"tl",width:13,draw:function() {
if (!Bangle.isLCDOn()) return; // dont redraw if LCD is off
var steps = Bangle.getHealthStatus("day").steps;
var w = 1 + (steps.toString().length)*12;
if (w > this.width) {this.width = w; setTimeout(() => Bangle.drawWidgets(),10); return;}
if (w != 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