Merge branch 'espruino:master' into master
commit
3c06f268b5
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,5 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
0.02: Shorten the timeout before executing to 250 ms.
|
0.02: Shorten the timeout before executing to 250 ms.
|
||||||
|
0.03: Add inner timeout of 150 ms so user has more time to release the button
|
||||||
|
before clock ui is initialized and adds it's button watch for going to
|
||||||
|
launcher.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{let buzzTimeout;
|
{let buzzTimeout;
|
||||||
setWatch((e)=>{
|
setWatch((e)=>{
|
||||||
if (e.state) buzzTimeout = setTimeout(()=>{Bangle.buzz(80,0.40);Bangle.showClock();}, 250);
|
if (e.state) buzzTimeout = setTimeout(()=>{Bangle.buzz(80,0.40);setTimeout(Bangle.showClock,150);}, 250);
|
||||||
if (!e.state && buzzTimeout) clearTimeout(buzzTimeout);},
|
if (!e.state && buzzTimeout) clearTimeout(buzzTimeout);},
|
||||||
BTN,{repeat:true, edge:'both' });}
|
BTN,{repeat:true,edge:'both'});}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{ "id": "fastreset",
|
{ "id": "fastreset",
|
||||||
"name": "Fast Reset",
|
"name": "Fast Reset",
|
||||||
"shortName":"Fast Reset",
|
"shortName":"Fast Reset",
|
||||||
"version":"0.02",
|
"version":"0.03",
|
||||||
"description": "Reset the watch by pressing the hardware button just a little bit longer than a click. If 'Fastload Utils' is installed this will typically be done with fastloading. A buzz acts as indicator.",
|
"description": "Reset the watch by pressing the hardware button just a little bit longer than a click. If 'Fastload Utils' is installed this will typically be done with fastloading. A buzz acts as indicator.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"type": "bootloader",
|
"type": "bootloader",
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,4 @@
|
||||||
0.03: Swipe down to see widgets
|
0.03: Swipe down to see widgets
|
||||||
Support for fast loading
|
Support for fast loading
|
||||||
0.04: Localisation request: added Miles and AM/PM
|
0.04: Localisation request: added Miles and AM/PM
|
||||||
|
0.05: Prevent exceptions from halting the draw cycle
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "pebbled",
|
"id": "pebbled",
|
||||||
"name": "Pebble Clock with distance",
|
"name": "Pebble Clock with distance",
|
||||||
"shortName": "Pebble + distance",
|
"shortName": "Pebble + distance",
|
||||||
"version": "0.04",
|
"version": "0.05",
|
||||||
"description": "Fork of Pebble Clock with distance in KM. Both step count and the distance are on the main screen. Default step length = 0.75m (can be changed in settings).",
|
"description": "Fork of Pebble Clock with distance in KM. Both step count and the distance are on the main screen. Default step length = 0.75m (can be changed in settings).",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"icon": "pebbled.png",
|
"icon": "pebbled.png",
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,13 @@ const h3 = 7*h/8 - 10;
|
||||||
let batteryWarning = false;
|
let batteryWarning = false;
|
||||||
|
|
||||||
let draw = function() {
|
let draw = function() {
|
||||||
|
// queue next draw
|
||||||
|
if (drawTimeout) clearTimeout(drawTimeout);
|
||||||
|
drawTimeout = setTimeout(function() {
|
||||||
|
drawTimeout = undefined;
|
||||||
|
draw();
|
||||||
|
}, 60000 - (Date.now() % 60000));
|
||||||
|
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
let da = date.toString().split(" ");
|
let da = date.toString().split(" ");
|
||||||
let timeStr = settings.localization === "US" ? tConv24(da[4].substr(0,5)) : da[4].substr(0,5);
|
let timeStr = settings.localization === "US" ? tConv24(da[4].substr(0,5)) : da[4].substr(0,5);
|
||||||
|
|
@ -101,13 +108,6 @@ let draw = function() {
|
||||||
else
|
else
|
||||||
g.setColor('#000'); // otherwise black regardless of theme
|
g.setColor('#000'); // otherwise black regardless of theme
|
||||||
g.drawString(distanceStr, w/2, ha + 107);
|
g.drawString(distanceStr, w/2, ha + 107);
|
||||||
|
|
||||||
// queue next draw
|
|
||||||
if (drawTimeout) clearTimeout(drawTimeout);
|
|
||||||
drawTimeout = setTimeout(function() {
|
|
||||||
drawTimeout = undefined;
|
|
||||||
draw();
|
|
||||||
}, 60000 - (Date.now() % 60000));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// at x,y width:wi thicknes:th
|
// at x,y width:wi thicknes:th
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,4 @@
|
||||||
0.03: Show day/month, add animations, fix !mylocation and text glitch
|
0.03: Show day/month, add animations, fix !mylocation and text glitch
|
||||||
0.04: Always show the widgets, swifter animations and lighter sea line
|
0.04: Always show the widgets, swifter animations and lighter sea line
|
||||||
0.05: Fixed hours increasing too early, added missing 23 o'clock, simplified code
|
0.05: Fixed hours increasing too early, added missing 23 o'clock, simplified code
|
||||||
|
0.06: Draw the screen exactly on the minute boundary
|
||||||
|
|
|
||||||
|
|
@ -358,13 +358,18 @@ function initialAnimation () {
|
||||||
initialAnimationFrame();
|
initialAnimationFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderAndQueue() {
|
||||||
|
setTimeout(renderAndQueue, 60000 - (Date.now() % 60000));
|
||||||
|
renderScreen();
|
||||||
|
}
|
||||||
|
|
||||||
function main () {
|
function main () {
|
||||||
sunRiseX = xfromTime(sunrise.getHours() + sunrise.getMinutes() / 60);
|
sunRiseX = xfromTime(sunrise.getHours() + sunrise.getMinutes() / 60);
|
||||||
sunSetX = xfromTime(sunset.getHours() + sunset.getMinutes() / 60);
|
sunSetX = xfromTime(sunset.getHours() + sunset.getMinutes() / 60);
|
||||||
|
|
||||||
g.setBgColor(0, 0, 0);
|
g.setBgColor(0, 0, 0);
|
||||||
g.clear();
|
g.clear();
|
||||||
setInterval(renderScreen, 60 * 1000);
|
renderAndQueue();
|
||||||
initialAnimation();
|
initialAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "sunrise",
|
"id": "sunrise",
|
||||||
"name": "Sunrise",
|
"name": "Sunrise",
|
||||||
"shortName": "Sunrise",
|
"shortName": "Sunrise",
|
||||||
"version": "0.05",
|
"version": "0.06",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"description": "Show sunrise and sunset times",
|
"description": "Show sunrise and sunset times",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue