diff --git a/apps/mtgwatchface/app.js b/apps/mtgwatchface/app.js index a90e9ba01..4f5587ad1 100644 --- a/apps/mtgwatchface/app.js +++ b/apps/mtgwatchface/app.js @@ -51,6 +51,16 @@ Graphics.prototype.setFontTreasurehuntDOYwE_40_N = function(scale) { return this; } +//Bluetooth on +var btOnImg = { + width : 15, height : 22, bpp : 3, + transparent : 2, + buffer : E.toArrayBuffer(atob("/////H//////A/////4A/////4BH////4JI////4JJH///4J5I///4BP5I///BJ/5A//BJPP5A/4JJ5P5H4J/PL/JHBJf/5JI4JJ/7JJIBP75/ZJAJZPJ/JIBJJ5/JJHBJP/JJA4JJ/JJI/4JPJJI//4BJJA////AAH//A==")) +} +var btOffImg = { + width : 15, height : 22, bpp : 1, + buffer : E.toArrayBuffer(atob("AAAAwAcAGgBEAQgEEBgQIDCAIQAiACgAUABgAMABgAKACQARAEGDAPgA")) +} function draw() { g.clear(); @@ -58,6 +68,7 @@ function draw() { drawDate(); drawTime(); drawBattery(); + drawBluetooth(); } function drawDate() { days = ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"] @@ -103,7 +114,13 @@ function drawBattery(){ } function drawBluetooth(){ - + var img; + if (NRF.getSecurityStatus().connected) { + img=btOnImg; + } else { + img=btOffImg; + } + g.reset().drawImage(img,3,3); } function drawBackground() { @@ -136,6 +153,9 @@ Bangle.setLocked(false); Bangle.setLCDPower(true); Bangle.setUI("clock"); +NRF.on('connect', draw); +NRF.on('disconnect', draw); + var redrawTimerId = setInterval(function(){ draw(); }, 60000); diff --git a/apps/mtgwatchface/metadata.json b/apps/mtgwatchface/metadata.json index 79ae3fb7d..3e1a9df29 100644 --- a/apps/mtgwatchface/metadata.json +++ b/apps/mtgwatchface/metadata.json @@ -2,7 +2,7 @@ "id": "mtgwatchface", "name": "MTG Watchface", "shortName": "Magic the Gathering Watch Face", - "version": "0v01", + "version": "1v01", "description": "Magic the Gathering themed watch face. Embrace the inner wizzard ", "icon": "icon.png", "screenshots": [