2021-02-12 20:34:10 +00:00
|
|
|
(function(){
|
2021-03-18 09:17:07 +00:00
|
|
|
if (!Bangle.isGPSOn) return; // old firmware
|
2021-05-28 13:38:14 +00:00
|
|
|
|
2021-02-12 20:34:10 +00:00
|
|
|
function draw() {
|
|
|
|
g.reset();
|
|
|
|
if (Bangle.isGPSOn()) {
|
2021-10-29 19:21:12 +00:00
|
|
|
g.setColor("#FD0"); // on = amber
|
2021-02-12 20:34:10 +00:00
|
|
|
} else {
|
2021-10-29 19:21:12 +00:00
|
|
|
g.setColor("#888"); // off = grey
|
2021-02-12 20:34:10 +00:00
|
|
|
}
|
2021-10-29 19:21:12 +00:00
|
|
|
g.drawImage(atob("GBiBAAAAAAAAAAAAAA//8B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+A//8AAAAAAAAAAAAA=="), this.x, 2+this.y);
|
2021-02-12 20:34:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var timerInterval;
|
|
|
|
Bangle.on('lcdPower', function(on) {
|
|
|
|
if (on) {
|
|
|
|
WIDGETS.gps.draw();
|
|
|
|
if (!timerInterval) timerInterval = setInterval(()=>WIDGETS["gps"].draw(), 2000);
|
|
|
|
} else {
|
|
|
|
if (timerInterval) {
|
|
|
|
clearInterval(timerInterval);
|
|
|
|
timerInterval = undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
WIDGETS.gps={area:"tr",width:24,draw:draw};
|
|
|
|
})();
|