forked from FOSS/BangleApps
Misc tweaks to reduce RAM usage - not really enough to warrant version change
parent
901adb4328
commit
2f2bd423dd
|
@ -1,13 +1,11 @@
|
|||
(function(){
|
||||
var img_bt = E.toArrayBuffer(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="));
|
||||
|
||||
function draw() {
|
||||
g.reset();
|
||||
if (NRF.getSecurityStatus().connected)
|
||||
g.setColor(0,0.5,1);
|
||||
else
|
||||
g.setColor(0.3,0.3,0.3);
|
||||
g.drawImage(img_bt,10+this.x,2+this.y);
|
||||
g.drawImage(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="),10+this.x,2+this.y);
|
||||
}
|
||||
function changed() {
|
||||
WIDGETS["bluetooth"].draw();
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
(function(){
|
||||
if (!Bangle.isGPSOn) return; // old firmware
|
||||
var img = E.toArrayBuffer(atob("GBiBAAAAAAAAAAAAAA//8B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+A//8AAAAAAAAAAAAA=="));
|
||||
|
||||
|
||||
function draw() {
|
||||
g.reset();
|
||||
if (Bangle.isGPSOn()) {
|
||||
|
@ -9,7 +8,7 @@
|
|||
} else {
|
||||
g.setColor(0.3,0.3,0.3); // off = grey
|
||||
}
|
||||
g.drawImage(img, 10+this.x, 2+this.y);
|
||||
g.drawImage(atob("GBiBAAAAAAAAAAAAAA//8B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+A//8AAAAAAAAAAAAA=="), 10+this.x, 2+this.y);
|
||||
}
|
||||
|
||||
var timerInterval;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
(function(){
|
||||
if (!Bangle.isHRMOn) return; // old firmware
|
||||
var img = E.toArrayBuffer(atob("FhaBAAAAAAAAAAAAAcDgD8/AYeGDAwMMDAwwADDAAMOABwYAGAwAwBgGADAwAGGAAMwAAeAAAwAAAAAAAAAAAAA="));
|
||||
|
||||
|
||||
function draw() {
|
||||
g.reset();
|
||||
if (Bangle.isHRMOn()) {
|
||||
|
@ -9,7 +8,7 @@
|
|||
} else {
|
||||
g.setColor(0.3,0.3,0.3); // off = grey
|
||||
}
|
||||
g.drawImage(img, 10+this.x, 2+this.y);
|
||||
g.drawImage(atob("FhaBAAAAAAAAAAAAAcDgD8/AYeGDAwMMDAwwADDAAMOABwYAGAwAwBgGADAwAGGAAMwAAeAAAwAAAAAAAAAAAAA="), 10+this.x, 2+this.y);
|
||||
}
|
||||
|
||||
var timerInterval;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
/* jshint esversion: 6 */
|
||||
(() => {
|
||||
var icon = require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA=="));
|
||||
var color = 0x4A69;
|
||||
|
||||
function draw() {
|
||||
g.reset().setColor(color).drawImage(icon, this.x + 1, 0);
|
||||
g.reset().setColor(color).drawImage(require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA==")), this.x + 1, 0);
|
||||
}
|
||||
|
||||
WIDGETS["widhwt"] = { area: "tr", width: 26, draw: draw };
|
||||
|
@ -20,4 +19,4 @@
|
|||
}, 35E3);
|
||||
|
||||
});
|
||||
})();
|
||||
})();
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
/* jshint esversion: 6 */
|
||||
(() => {
|
||||
var id = NRF.getAddress().substr().substr(12).split(":");
|
||||
|
||||
// draw your widget at xpos
|
||||
function draw() {
|
||||
var id = NRF.getAddress().substr().substr(12).split(":");
|
||||
g.reset().setColor(0, 0.5, 1).setFont("6x8", 1);
|
||||
g.drawString(id[0], this.x+2, this.y+4, true);
|
||||
g.drawString(id[1], this.x+2, this.y+14, true);
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
/* 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.reset().setColor(CBS).drawImage(require("heatshrink").decompress(atob("j0TwIHEv///kD////EfAYPwuEAgPB4EAg/HCgMfzgDBvwOC/IOC84ONDoUcFgc/AYOAHYRDE")), 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);
|
||||
|
|
|
@ -1,34 +1,33 @@
|
|||
(() => {
|
||||
|
||||
var saved = null;
|
||||
|
||||
|
||||
function hide(){
|
||||
if (!Bangle.isLCDOn() || saved) return;
|
||||
saved = [];
|
||||
for (var wd of WIDGETS) {
|
||||
saved.push(wd.draw);
|
||||
saved.push(wd.draw);
|
||||
wd.draw=()=>{};
|
||||
}
|
||||
g.setColor(0,0,0);
|
||||
g.fillRect(0,0,239,23);
|
||||
}
|
||||
|
||||
|
||||
function reveal(){
|
||||
if (!Bangle.isLCDOn() || !saved) return;
|
||||
for (var wd of WIDGETS) wd.draw = saved.shift();
|
||||
Bangle.drawWidgets();
|
||||
Bangle.drawWidgets();
|
||||
saved=null;
|
||||
}
|
||||
|
||||
|
||||
function draw(){
|
||||
var img = E.toArrayBuffer(atob("GBgBAAAAAAAAAAAAAAAAAH4AAf+AB4HgDgBwHDw4OH4cMOcMYMMGYMMGMOcMOH4cHDw4DgBwB4HgAf+AAH4AAAAAAAAAAAAAAAAA"));
|
||||
g.setColor(0x07ff);
|
||||
g.drawImage(img,this.x,this.y);
|
||||
g.drawImage(atob("GBgBAAAAAAAAAAAAAAAAAH4AAf+AB4HgDgBwHDw4OH4cMOcMYMMGYMMGMOcMOH4cHDw4DgBwB4HgAf+AAH4AAAAAAAAAAAAAAAAA"),this.x,this.y);
|
||||
}
|
||||
|
||||
|
||||
WIDGETS["viz"] ={area:"tl", width:24,draw:draw};
|
||||
|
||||
Bangle.on('swipe',(dir)=>{
|
||||
if (dir<0) hide(); else reveal();
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue