mirror of https://github.com/espruino/BangleApps
Merge pull request #439 from jeffmer/master
Update of widviz to use swipe rather than buttons.pull/440/head
commit
793b5d6361
|
@ -1766,8 +1766,8 @@
|
|||
"name": "Widget Visibility Widget",
|
||||
"shortName":"Viz Widget",
|
||||
"icon": "eye.png",
|
||||
"version":"0.01",
|
||||
"description": "Touch left screen to hide top bar widgets, right screen to redisplay. Will not work with apps that use BTN4 & BTN5.",
|
||||
"version":"0.02",
|
||||
"description": "Swipe left to hide top bar widgets, swipe right to redisplay.",
|
||||
"tags": "widget",
|
||||
"type": "widget",
|
||||
"storage": [
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
0.01: New Widget
|
||||
0.02: swipe left,right update
|
||||
|
||||
|
|
|
@ -20,18 +20,15 @@
|
|||
saved=null;
|
||||
}
|
||||
|
||||
function setup(){
|
||||
setWatch(hide, BTN4, {repeat:true,edge:"rising"});
|
||||
setWatch(reveal, BTN5, {repeat:true,edge:"rising"});
|
||||
}
|
||||
|
||||
function draw(){
|
||||
var img = E.toArrayBuffer(atob("GBgBAAAAAAAAAAAAAAAAAH4AAf+AB4HgDgBwHDw4OH4cMOcMYMMGYMMGMOcMOH4cHDw4DgBwB4HgAf+AAH4AAAAAAAAAAAAAAAAA"));
|
||||
g.setColor(0x07ff);
|
||||
g.drawImage(img,this.x,this.y);
|
||||
}
|
||||
|
||||
WIDGETS["viz"] ={area:"tl", width:24,draw:draw,setup:setup};
|
||||
setup();
|
||||
|
||||
WIDGETS["viz"] ={area:"tl", width:24,draw:draw};
|
||||
|
||||
Bangle.on('swipe',(dir)=>{
|
||||
if (dir<0) hide(); else reveal();
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue