1
0
Fork 0

Merge pull request #189 from Xaseron/gbridge

Gadgetbridge notification optimization
master
Gordon Williams 2020-04-02 20:36:35 +01:00 committed by GitHub
commit 668f7bb549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -91,7 +91,7 @@
{ "id": "gbridge", { "id": "gbridge",
"name": "Gadgetbridge", "name": "Gadgetbridge",
"icon": "app.png", "icon": "app.png",
"version":"0.04", "version":"0.05",
"description": "The default notification handler for Gadgetbridge notifications from Android", "description": "The default notification handler for Gadgetbridge notifications from Android",
"tags": "tool,system,android,widget", "tags": "tool,system,android,widget",
"storage": [ "storage": [

View File

@ -2,3 +2,4 @@
0.02: Increase contrast (darker notification background, white text) 0.02: Increase contrast (darker notification background, white text)
0.03: Gadgetbridge widget now shows connection state 0.03: Gadgetbridge widget now shows connection state
0.04: Tweaks for variable size widget system 0.04: Tweaks for variable size widget system
0.05: Optimize animation, limit title length

View File

@ -22,7 +22,7 @@
scrollPos-=2; scrollPos-=2;
if (scrollPos<-size) scrollPos=-size; if (scrollPos<-size) scrollPos=-size;
Bangle.setLCDOffset(scrollPos); Bangle.setLCDOffset(scrollPos);
if (scrollPos>-size) setTimeout(anim,10); if (scrollPos>-size) setTimeout(anim,15);
} }
anim(); anim();
} }
@ -58,7 +58,8 @@
g.drawString(j.src,x,y+7); g.drawString(j.src,x,y+7);
g.setColor("#ffffff"); g.setColor("#ffffff");
g.setFont("6x8",2); g.setFont("6x8",2);
g.drawString(j.title,x,y+25); if (j.title === undefined) g.drawString(j.title,x,y+25);
else g.drawString(j.title.slice(0,17),x,y+25);
g.setFont("6x8",1); g.setFont("6x8",1);
g.setColor("#ffffff"); g.setColor("#ffffff");
// split text up a word boundaries // split text up a word boundaries
@ -89,7 +90,7 @@
if (musicState=="play") if (musicState=="play")
show(40,function(y) { show(40,function(y) {
g.setColor("#ffffff"); g.setColor("#ffffff");
g.drawImage( require("heatshrink").decompress(atob("jEYwILI/EAv/8gP/ARcMgOAASN8h+A/kfwP8n4CD/E/gHgjg/HA=")),8,y+8); g.drawImage(require("heatshrink").decompress(atob("jEYwILI/EAv/8gP/ARcMgOAASN8h+A/kfwP8n4CD/E/gHgjg/HA=")),8,y+8);
g.setFontAlign(-1,-1); g.setFontAlign(-1,-1);
g.setFont("6x8",1); g.setFont("6x8",1);
var x = 40; var x = 40;