|
|
|
@ -1,11 +1,3 @@
|
|
|
|
var SunCalc = require("suncalc");
|
|
|
|
|
|
|
|
const SETTINGS_FILE = "rebble.json";
|
|
|
|
|
|
|
|
const LOCATION_FILE = "mylocation.json";
|
|
|
|
|
|
|
|
const GLOBAL_SETTINGS = "setting.json";
|
|
|
|
|
|
|
|
let settings;
|
|
|
|
|
|
|
|
let location;
|
|
|
|
|
|
|
|
let is12Hour;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Graphics.prototype.setFontKdamThmor = function(scale) {
|
|
|
|
Graphics.prototype.setFontKdamThmor = function(scale) {
|
|
|
|
// Actual height 70 (69 - 0)
|
|
|
|
// Actual height 70 (69 - 0)
|
|
|
|
this.setFontCustom(
|
|
|
|
this.setFontCustom(
|
|
|
|
@ -17,26 +9,37 @@ Graphics.prototype.setFontKdamThmor = function(scale) {
|
|
|
|
return this;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var boot_img = require("heatshrink").decompress(atob("oFAwkEogA/AH4A/AH4A/AH4A/AE8AAAoeXoAfeDQUBmcyD7A+Dh///8QD649CiAfaHwUvD4sEHy0DDYIfEICg+Cn4fHICY+DD4nxcgojOHwgfEIAYfRCIQaDD4ZAFD5r7DH4//kAfRCIZ/GAAnwD5p9DX44fTHgYSBf4ofVDAQEBl4fFUAgfOXoQzBgIfFBAIfPP4RAEAoYAB+cRiK/SG4h/WIBAfXIA7CBAAswD55AHn6fUIBMCD65AHl4gCmcziAfQQJqfQQJpiDgk0IDXxQLRAEECaBM+QgRYRYgUIA0CD4ggSQJiDCiAKBICszAAswD55AHABKBVD7BAFABIqBD5pAFABPxD55AOD6BADiIAJQAyxLABwf/gaAPAH4A/AH4ARA=="));
|
|
|
|
|
|
|
|
var sunrise_img = require("heatshrink").decompress(atob("oFAwkEogA/AH4A/AH4A/AH4ACp5A/AH4A/AH4AIoEAggfcgAABD/4f/D/4f/CiNPmgfUoYIHoEAggfSoEQgYJGmAUJD5QJBgQ/IIBBKJChiVSCYR1LBZAzTICQyNICAxOICAwPD40xA4UTc5xAFiAuDiAWCAAMBc5hgHDxAgFeCKEDh//AAPwdiKDHh9PD4X0EAX0DyQ+BHoYgFh4+UDwofB/68OAAlBHw6CEQKITBDxAABMCReHUQhgSLxRgDDx9CD4g8DD4sUbqEUH5SABUB4fBDxYfKkQAFkEAiQJGAAcjgECBQ6qBAH4A9Y5wA/AH4Aw"));
|
|
|
|
|
|
|
|
var sunset_img = require("heatshrink").decompress(atob("oFAwkEogA/AH4A/AH4A/AH4A/AH4A/AH4AMoEAggfcgAABD/4f/D/4f/CqU0D6lDBA9AgEED6VAiEDBI0wChIfKBIMCH5BAIJRIUMSqQTCOpYLIGaZASGRpAQGJxAQGB4fGmIHCibnOIAsQFwcQCwQABgLnMMA4eIEArwRQgY0DAwwARC44gC+geSORJ8PHw4KTABFBGhRAT+AzLgEPLzZgUKRhgBDx9CD50UbqARMUCBROD5MiAAsggESBIwADkcAgQKHVQIA/AHrHOAH4A/AGA"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var drawCount = 0;
|
|
|
|
{
|
|
|
|
var sideBar = 0;
|
|
|
|
let SunCalc = require("suncalc");
|
|
|
|
var sunRise = "00:00";
|
|
|
|
const SETTINGS_FILE = "rebble.json";
|
|
|
|
var sunSet = "00:00";
|
|
|
|
const LOCATION_FILE = "mylocation.json";
|
|
|
|
|
|
|
|
const GLOBAL_SETTINGS = "setting.json";
|
|
|
|
|
|
|
|
let settings;
|
|
|
|
|
|
|
|
let location;
|
|
|
|
|
|
|
|
let is12Hour;
|
|
|
|
|
|
|
|
|
|
|
|
function log_debug(o) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let boot_img = require("heatshrink").decompress(atob("oFAwkEogA/AH4A/AH4A/AH4A/AE8AAAoeXoAfeDQUBmcyD7A+Dh///8QD649CiAfaHwUvD4sEHy0DDYIfEICg+Cn4fHICY+DD4nxcgojOHwgfEIAYfRCIQaDD4ZAFD5r7DH4//kAfRCIZ/GAAnwD5p9DX44fTHgYSBf4ofVDAQEBl4fFUAgfOXoQzBgIfFBAIfPP4RAEAoYAB+cRiK/SG4h/WIBAfXIA7CBAAswD55AHn6fUIBMCD65AHl4gCmcziAfQQJqfQQJpiDgk0IDXxQLRAEECaBM+QgRYRYgUIA0CD4ggSQJiDCiAKBICszAAswD55AHABKBVD7BAFABIqBD5pAFABPxD55AOD6BADiIAJQAyxLABwf/gaAPAH4A/AH4ARA=="));
|
|
|
|
|
|
|
|
let sunrise_img = require("heatshrink").decompress(atob("oFAwkEogA/AH4A/AH4A/AH4ACp5A/AH4A/AH4AIoEAggfcgAABD/4f/D/4f/CiNPmgfUoYIHoEAggfSoEQgYJGmAUJD5QJBgQ/IIBBKJChiVSCYR1LBZAzTICQyNICAxOICAwPD40xA4UTc5xAFiAuDiAWCAAMBc5hgHDxAgFeCKEDh//AAPwdiKDHh9PD4X0EAX0DyQ+BHoYgFh4+UDwofB/68OAAlBHw6CEQKITBDxAABMCReHUQhgSLxRgDDx9CD4g8DD4sUbqEUH5SABUB4fBDxYfKkQAFkEAiQJGAAcjgECBQ6qBAH4A9Y5wA/AH4Aw"));
|
|
|
|
|
|
|
|
let sunset_img = require("heatshrink").decompress(atob("oFAwkEogA/AH4A/AH4A/AH4A/AH4A/AH4AMoEAggfcgAABD/4f/D/4f/CqU0D6lDBA9AgEED6VAiEDBI0wChIfKBIMCH5BAIJRIUMSqQTCOpYLIGaZASGRpAQGJxAQGB4fGmIHCibnOIAsQFwcQCwQABgLnMMA4eIEArwRQgY0DAwwARC44gC+geSORJ8PHw4KTABFBGhRAT+AzLgEPLzZgUKRhgBDx9CD50UbqARMUCBROD5MiAAsggESBIwADkcAgQKHVQIA/AHrHOAH4A/AGA"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let drawCount = 0;
|
|
|
|
|
|
|
|
let sideBar = 0;
|
|
|
|
|
|
|
|
let sunRise = "00:00";
|
|
|
|
|
|
|
|
let sunSet = "00:00";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_debug= function(o) {
|
|
|
|
//console.log(o);
|
|
|
|
//console.log(o);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// requires the myLocation app
|
|
|
|
// requires the myLocation app
|
|
|
|
function loadLocation() {
|
|
|
|
let loadLocation= function() {
|
|
|
|
location = require("Storage").readJSON(LOCATION_FILE,1)||{"lat":51.5072,"lon":0.1276,"location":"London"};
|
|
|
|
location = require("Storage").readJSON(LOCATION_FILE,1)||{"lat":51.5072,"lon":0.1276,"location":"London"};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function loadSettings() {
|
|
|
|
let loadSettings=function() {
|
|
|
|
settings = {'bg': '#0f0', 'color': 'Green', 'autoCycle': true,'sideTap':0};
|
|
|
|
settings = {'bg': '#0f0', 'color': 'Green', 'autoCycle': true,'sideTap':0};
|
|
|
|
//sideTap 0 = on | 1 = sidebar1...
|
|
|
|
//sideTap 0 = on | 1 = sidebar1...
|
|
|
|
|
|
|
|
|
|
|
|
@ -46,13 +49,13 @@ function loadSettings() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(settings.sideTap!=0)
|
|
|
|
if(settings.sideTap!=0)
|
|
|
|
sideBar=parseInt(settings.sideTap)-1; //tab to show
|
|
|
|
sideBar=parseInt(settings.sideTap)-1; //tab to
|
|
|
|
is12Hour = (require("Storage").readJSON(GLOBAL_SETTINGS, 1) || {})["12hour"] || false;
|
|
|
|
is12Hour = (require("Storage").readJSON(GLOBAL_SETTINGS, 1) || {})["12hour"] || false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const zeroPad = (num, places) => String(num).padStart(places, '0')
|
|
|
|
const zeroPad = (num, places) => String(num).padStart(places, '0')
|
|
|
|
|
|
|
|
|
|
|
|
function formatHours(h) {
|
|
|
|
let formatHours=function(h) {
|
|
|
|
if (is12Hour) {
|
|
|
|
if (is12Hour) {
|
|
|
|
if (h == 0) {
|
|
|
|
if (h == 0) {
|
|
|
|
h = 12;
|
|
|
|
h = 12;
|
|
|
|
@ -63,14 +66,14 @@ function formatHours(h) {
|
|
|
|
return zeroPad(h, 2);
|
|
|
|
return zeroPad(h, 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function extractTime(d){
|
|
|
|
let extractTime=function(d){
|
|
|
|
var h = d.getHours(), m = d.getMinutes();
|
|
|
|
let h = d.getHours(), m = d.getMinutes();
|
|
|
|
return(formatHours(h) + ":" + zeroPad(m, 2));
|
|
|
|
return(formatHours(h) + ":" + zeroPad(m, 2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function updateSunRiseSunSet(lat, lon){
|
|
|
|
let updateSunRiseSunSet=function(lat, lon){
|
|
|
|
// get today's sunlight times for lat/lon
|
|
|
|
// get today's sunlight times for lat/lon
|
|
|
|
var times = SunCalc.getTimes(new Date(), lat, lon);
|
|
|
|
let times = SunCalc.getTimes(new Date(), lat, lon);
|
|
|
|
|
|
|
|
|
|
|
|
// format sunrise time from the Date object
|
|
|
|
// format sunrise time from the Date object
|
|
|
|
sunRise = extractTime(times.sunrise);
|
|
|
|
sunRise = extractTime(times.sunrise);
|
|
|
|
@ -78,12 +81,12 @@ function updateSunRiseSunSet(lat, lon){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// wrapper, makes it easier if we want to switch to a different font later
|
|
|
|
// wrapper, makes it easier if we want to switch to a different font later
|
|
|
|
function setSmallFont() {
|
|
|
|
let setSmallFont=function() {
|
|
|
|
g.setFont('Vector', 20);
|
|
|
|
g.setFont('Vector', 20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// set the text color of the sidebar elements that dont change with the Theme
|
|
|
|
// set the text color of the sidebar elements that dont change with the Theme
|
|
|
|
function setTextColor() {
|
|
|
|
let setTextColor=function() {
|
|
|
|
// day and steps
|
|
|
|
// day and steps
|
|
|
|
if (settings.color == 'Blue' || settings.color == 'Red') {
|
|
|
|
if (settings.color == 'Blue' || settings.color == 'Red') {
|
|
|
|
g.setColor('#fff'); // white on blue or red best contrast
|
|
|
|
g.setColor('#fff'); // white on blue or red best contrast
|
|
|
|
@ -94,15 +97,15 @@ function setTextColor() {
|
|
|
|
|
|
|
|
|
|
|
|
const h = g.getHeight();
|
|
|
|
const h = g.getHeight();
|
|
|
|
const w = g.getWidth();
|
|
|
|
const w = g.getWidth();
|
|
|
|
const ha = 2*h/5 - 8;
|
|
|
|
/*const ha = 2*h/5 - 8;
|
|
|
|
const h2 = 3*h/5 - 10;
|
|
|
|
const h2 = 3*h/5 - 10;
|
|
|
|
const h3 = 7*h/8;
|
|
|
|
const h3 = 7*h/8;*/
|
|
|
|
const w2 = 9*w/14;
|
|
|
|
const w2 = 9*w/14;
|
|
|
|
const w3 = w2 + ((w - w2)/2); // centre line of the sidebar
|
|
|
|
const w3 = w2 + ((w - w2)/2); // centre line of the sidebar
|
|
|
|
const ws = w - w2; // sidebar width
|
|
|
|
const ws = w - w2; // sidebar width
|
|
|
|
const wb = 40; // battery width
|
|
|
|
const wb = 40; // battery width
|
|
|
|
|
|
|
|
|
|
|
|
function draw() {
|
|
|
|
let draw=function() {
|
|
|
|
log_debug("draw()");
|
|
|
|
log_debug("draw()");
|
|
|
|
let date = new Date();
|
|
|
|
let date = new Date();
|
|
|
|
let hh = date.getHours();
|
|
|
|
let hh = date.getHours();
|
|
|
|
@ -145,7 +148,7 @@ function draw() {
|
|
|
|
queueDraw();
|
|
|
|
queueDraw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function drawSideBar1() {
|
|
|
|
let drawSideBar1=function() {
|
|
|
|
let date = new Date();
|
|
|
|
let date = new Date();
|
|
|
|
let dy=require("date_utils").dow(date.getDay(),1).toUpperCase();
|
|
|
|
let dy=require("date_utils").dow(date.getDay(),1).toUpperCase();
|
|
|
|
let dd=date.getDate();
|
|
|
|
let dd=date.getDate();
|
|
|
|
@ -162,7 +165,7 @@ function drawSideBar1() {
|
|
|
|
drawDateAndCalendar(w3, h/2, dy, dd, mm);
|
|
|
|
drawDateAndCalendar(w3, h/2, dy, dd, mm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function drawSideBar2() {
|
|
|
|
let drawSideBar2=function() {
|
|
|
|
drawBattery(w2 + (w-w2-wb)/2, h/10, wb, 17);
|
|
|
|
drawBattery(w2 + (w-w2-wb)/2, h/10, wb, 17);
|
|
|
|
|
|
|
|
|
|
|
|
setTextColor();
|
|
|
|
setTextColor();
|
|
|
|
@ -178,7 +181,7 @@ function drawSideBar2() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// sunrise, sunset times
|
|
|
|
// sunrise, sunset times
|
|
|
|
function drawSideBar3() {
|
|
|
|
let drawSideBar3=function() {
|
|
|
|
g.setColor('#fff'); // sunrise white
|
|
|
|
g.setColor('#fff'); // sunrise white
|
|
|
|
g.drawImage(sunrise_img, w2 + (ws - 64)/2, 0, { scale: 1 });
|
|
|
|
g.drawImage(sunrise_img, w2 + (ws - 64)/2, 0, { scale: 1 });
|
|
|
|
setTextColor();
|
|
|
|
setTextColor();
|
|
|
|
@ -194,7 +197,7 @@ function drawSideBar3() {
|
|
|
|
g.drawString(sunSet, w3, (h/2) + 64);
|
|
|
|
g.drawString(sunSet, w3, (h/2) + 64);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function drawDateAndCalendar(x,y,dy,dd,mm) {
|
|
|
|
let drawDateAndCalendar=function(x,y,dy,dd,mm) {
|
|
|
|
// day
|
|
|
|
// day
|
|
|
|
setTextColor();
|
|
|
|
setTextColor();
|
|
|
|
setSmallFont();
|
|
|
|
setSmallFont();
|
|
|
|
@ -211,7 +214,7 @@ function drawDateAndCalendar(x,y,dy,dd,mm) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// at x,y width:wi thicknes:th
|
|
|
|
// at x,y width:wi thicknes:th
|
|
|
|
function drawCalendar(x,y,wi,th,str) {
|
|
|
|
let drawCalendar=function(x,y,wi,th,str) {
|
|
|
|
g.setColor(g.theme.fg);
|
|
|
|
g.setColor(g.theme.fg);
|
|
|
|
g.fillRect(x, y, x + wi, y + wi);
|
|
|
|
g.fillRect(x, y, x + wi, y + wi);
|
|
|
|
g.setColor(g.theme.bg);
|
|
|
|
g.setColor(g.theme.bg);
|
|
|
|
@ -229,7 +232,7 @@ function drawCalendar(x,y,wi,th,str) {
|
|
|
|
g.drawString(str, x + wi/2 + th/2, y + wi/2 + th/2);
|
|
|
|
g.drawString(str, x + wi/2 + th/2, y + wi/2 + th/2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function drawBattery(x,y,wi,hi) {
|
|
|
|
let drawBattery=function(x,y,wi,hi) {
|
|
|
|
g.reset();
|
|
|
|
g.reset();
|
|
|
|
g.setColor(g.theme.fg);
|
|
|
|
g.setColor(g.theme.fg);
|
|
|
|
g.fillRect(x,y+2,x+wi-4,y+2+hi); // outer
|
|
|
|
g.fillRect(x,y+2,x+wi-4,y+2+hi); // outer
|
|
|
|
@ -238,6 +241,7 @@ function drawBattery(x,y,wi,hi) {
|
|
|
|
g.fillRect(x+wi-3,y+2+(((hi - 1)/2)-1),x+wi-2,y+2+(((hi - 1)/2)-1)+4); // contact
|
|
|
|
g.fillRect(x+wi-3,y+2+(((hi - 1)/2)-1),x+wi-2,y+2+(((hi - 1)/2)-1)+4); // contact
|
|
|
|
g.fillRect(x+3, y+5, x +3 + E.getBattery()*(wi-10)/100, y+hi-1); // the level
|
|
|
|
g.fillRect(x+3, y+5, x +3 + E.getBattery()*(wi-10)/100, y+hi-1); // the level
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log_debug("Charging "+Bangle.isCharging());
|
|
|
|
if( Bangle.isCharging() )
|
|
|
|
if( Bangle.isCharging() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g.setBgColor(settings.bg);
|
|
|
|
g.setBgColor(settings.bg);
|
|
|
|
@ -248,8 +252,8 @@ function drawBattery(x,y,wi,hi) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// format steps so they fit in the place
|
|
|
|
// format steps so they fit in the place
|
|
|
|
function formatSteps() {
|
|
|
|
let formatSteps=function() {
|
|
|
|
var s = Bangle.getHealthStatus("day").steps;
|
|
|
|
let s = Bangle.getHealthStatus("day").steps;
|
|
|
|
|
|
|
|
|
|
|
|
if (s < 1000) {
|
|
|
|
if (s < 1000) {
|
|
|
|
return s + '';
|
|
|
|
return s + '';
|
|
|
|
@ -259,27 +263,23 @@ function formatSteps() {
|
|
|
|
return Math.floor(s / 1000) + 'K';
|
|
|
|
return Math.floor(s / 1000) + 'K';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function nextSidebar() {
|
|
|
|
let nextSidebar=function() {
|
|
|
|
|
|
|
|
|
|
|
|
if (++sideBar > 2) sideBar = 0;
|
|
|
|
if (++sideBar > 2) sideBar = 0;
|
|
|
|
log_debug("next: " + sideBar);
|
|
|
|
log_debug("next: " + sideBar);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function prevSidebar() {
|
|
|
|
let prevSidebar=function() {
|
|
|
|
|
|
|
|
|
|
|
|
if (--sideBar < 0) sideBar = 2;
|
|
|
|
if (--sideBar < 0) sideBar = 2;
|
|
|
|
log_debug("prev: " + sideBar);
|
|
|
|
log_debug("prev: " + sideBar);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// timeout used to update every minute
|
|
|
|
// timeout used to update every minute
|
|
|
|
var drawTimeout;
|
|
|
|
let drawTimeout;
|
|
|
|
|
|
|
|
|
|
|
|
// schedule a draw for the next minute
|
|
|
|
// schedule a draw for the next minute
|
|
|
|
function queueDraw() {
|
|
|
|
let queueDraw=function() {
|
|
|
|
if (drawTimeout) clearTimeout(drawTimeout);
|
|
|
|
if (drawTimeout) clearTimeout(drawTimeout);
|
|
|
|
drawTimeout = setTimeout(function() {
|
|
|
|
drawTimeout = setTimeout(function() {
|
|
|
|
drawTimeout = undefined;
|
|
|
|
drawTimeout = undefined;
|
|
|
|
@ -298,24 +298,42 @@ loadLocation();
|
|
|
|
|
|
|
|
|
|
|
|
if(settings.autoCycle || settings.sideTap==0)
|
|
|
|
if(settings.autoCycle || settings.sideTap==0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Bangle.setUI("clockupdown", btn=> {
|
|
|
|
Bangle.setUI({
|
|
|
|
|
|
|
|
mode : "clockupdown",
|
|
|
|
|
|
|
|
remove : function() {
|
|
|
|
|
|
|
|
// Called to unload all of the clock app
|
|
|
|
|
|
|
|
if (drawTimeout) clearTimeout(drawTimeout);
|
|
|
|
|
|
|
|
drawTimeout = undefined;
|
|
|
|
|
|
|
|
delete Graphics.prototype.setFontKdamThmor;
|
|
|
|
|
|
|
|
}},
|
|
|
|
|
|
|
|
btn=> {
|
|
|
|
if (btn<0) prevSidebar();
|
|
|
|
if (btn<0) prevSidebar();
|
|
|
|
if (btn>0) nextSidebar();
|
|
|
|
if (btn>0) nextSidebar();
|
|
|
|
draw();
|
|
|
|
draw();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
Bangle.setUI("clock");
|
|
|
|
Bangle.setUI({
|
|
|
|
|
|
|
|
mode : "clock",
|
|
|
|
|
|
|
|
remove : function() {
|
|
|
|
|
|
|
|
// Called to unload all of the clock app
|
|
|
|
|
|
|
|
if (drawTimeout) clearTimeout(drawTimeout);
|
|
|
|
|
|
|
|
drawTimeout = undefined;
|
|
|
|
|
|
|
|
delete Graphics.prototype.setFontKdamThmor;
|
|
|
|
|
|
|
|
}});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bangle.loadWidgets();
|
|
|
|
Bangle.loadWidgets();
|
|
|
|
|
|
|
|
draw();
|
|
|
|
require("widget_utils").hide();
|
|
|
|
require("widget_utils").hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw(); // queues the next draw for a minutes time
|
|
|
|
|
|
|
|
Bangle.on('charging', function(charging) {
|
|
|
|
Bangle.on('charging', function(charging) {
|
|
|
|
|
|
|
|
|
|
|
|
//redraw the sidebar ( with the battery )
|
|
|
|
//redraw the sidebar ( with the battery )
|
|
|
|
switch(sideBar) {
|
|
|
|
switch(sideBar) {
|
|
|
|
case 0:
|
|
|
|
case 0:
|
|
|
|
@ -326,3 +344,4 @@ Bangle.on('charging', function(charging) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|