commit
166f619dae
15
apps.json
15
apps.json
|
|
@ -5098,6 +5098,21 @@
|
|||
{"name":"ltherm.img","url":"icon.js","evaluate":true}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "widviztime",
|
||||
"name": "Widget Autohide Widget",
|
||||
"shortName": "Viz Time Widget",
|
||||
"version": "0.01",
|
||||
"description": "The widgets will be shown for four seconds after the device is unlocked.",
|
||||
"icon": "eye.png",
|
||||
"type": "widget",
|
||||
"tags": "widget",
|
||||
"readme":"README.md",
|
||||
"supports": ["BANGLEJS","BANGLEJS2"],
|
||||
"storage": [
|
||||
{"name":"widviztime.wid.js","url":"widget.js"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "supf",
|
||||
"name": "Simple Clock with Date",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
# Widget Autohide Widget
|
||||
This widget is forked from the "Widget Visibility Widget"
|
||||
It should make widgets completely hidden (except for 4 seconds after the watch is unlocked)
|
||||
|
||||
Additional features that I want to implement:
|
||||
- Only show widgets when in app launcher
|
||||
- Make timeout adjustable
|
||||
- Disable widgets completely
|
||||
|
|
@ -0,0 +1 @@
|
|||
0.01: New Widget, forked from widviz
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
|
|
@ -0,0 +1,53 @@
|
|||
(() => {
|
||||
|
||||
var saved = null;
|
||||
|
||||
|
||||
function hide() {
|
||||
if (!Bangle.isLCDOn() || saved) return;
|
||||
saved = [];
|
||||
for (var wd of WIDGETS) {
|
||||
saved.push({
|
||||
d: wd.draw,
|
||||
a: wd.area
|
||||
});
|
||||
wd.draw = () => {};
|
||||
wd.area = "";
|
||||
}
|
||||
g.setColor(0, 0, 0);
|
||||
g.fillRect(0, 0, g.getWidth(), 23);
|
||||
}
|
||||
|
||||
function reveal() {
|
||||
if (!Bangle.isLCDOn() || !saved) return;
|
||||
for (var wd of WIDGETS) {
|
||||
var o = saved.shift();
|
||||
wd.draw = o.d;
|
||||
wd.area = o.a;
|
||||
}
|
||||
Bangle.drawWidgets();
|
||||
saved = null;
|
||||
}
|
||||
|
||||
function draw() {
|
||||
g.setColor(0x07ff);
|
||||
g.drawImage(atob("GBgBAAAAAAAAAAAAAAAAAH4AAf+AB4HgDgBwHDw4OH4cMOcMYMMGYMMGMOcMOH4cHDw4DgBwB4HgAf+AAH4AAAAAAAAAAAAAAAAA"), this.x, this.y);
|
||||
}
|
||||
|
||||
WIDGETS.viz = {
|
||||
area: "tl",
|
||||
width: 24,
|
||||
draw: draw
|
||||
};
|
||||
|
||||
|
||||
|
||||
Bangle.on('lock', (locked) => {
|
||||
if (!locked) {
|
||||
reveal();
|
||||
setTimeout(function() {
|
||||
hide();
|
||||
}, 4000);
|
||||
}
|
||||
});
|
||||
})();
|
||||
Loading…
Reference in New Issue