CalClock: Add buzzing before events
parent
752ef5512b
commit
27d7c7820a
|
|
@ -4,3 +4,4 @@
|
||||||
0.04: Improve current time readability in light theme.
|
0.04: Improve current time readability in light theme.
|
||||||
0.05: Show calendar colors & improved all day events.
|
0.05: Show calendar colors & improved all day events.
|
||||||
0.06: Improved multi-line locations & titles
|
0.06: Improved multi-line locations & titles
|
||||||
|
0.07: Buzz 30, 15 and 1 minute before an event
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,17 @@ function fullRedraw() {
|
||||||
drawFutureEvents(y);
|
drawFutureEvents(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buzzForEvents() {
|
||||||
|
let nextEvent = next[0]; if (!nextEvent) return;
|
||||||
|
if (nextEvent.allDay) return;
|
||||||
|
let minToEvent = Math.round((nextEvent.timestamp - getTime()) / 60.0);
|
||||||
|
switch (minToEvent) {
|
||||||
|
case 30: require("buzz").pattern(","); break;
|
||||||
|
case 15: require("buzz").pattern(", ,"); break;
|
||||||
|
case 1: require("buzz").pattern(": : :"); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function redraw() {
|
function redraw() {
|
||||||
g.reset();
|
g.reset();
|
||||||
if (current.find(e=>!isActive(e)) || next.find(isActive)) {
|
if (current.find(e=>!isActive(e)) || next.find(isActive)) {
|
||||||
|
|
@ -124,10 +135,12 @@ function redraw() {
|
||||||
} else {
|
} else {
|
||||||
drawCurrentEvents(30);
|
drawCurrentEvents(30);
|
||||||
}
|
}
|
||||||
|
buzzForEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
g.clear();
|
g.clear();
|
||||||
fullRedraw();
|
fullRedraw();
|
||||||
|
buzzForEvents();
|
||||||
var minuteInterval = setInterval(redraw, 60 * 1000);
|
var minuteInterval = setInterval(redraw, 60 * 1000);
|
||||||
|
|
||||||
Bangle.setUI("clock");
|
Bangle.setUI("clock");
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "calclock",
|
"id": "calclock",
|
||||||
"name": "Calendar Clock",
|
"name": "Calendar Clock",
|
||||||
"shortName": "CalClock",
|
"shortName": "CalClock",
|
||||||
"version": "0.06",
|
"version": "0.07",
|
||||||
"description": "Show the current and upcoming events synchronized from Gadgetbridge",
|
"description": "Show the current and upcoming events synchronized from Gadgetbridge",
|
||||||
"icon": "calclock.png",
|
"icon": "calclock.png",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue