diff --git a/apps/bigclkinfo/ChangeLog b/apps/bigclkinfo/ChangeLog new file mode 100644 index 0000000000..09953593e2 --- /dev/null +++ b/apps/bigclkinfo/ChangeLog @@ -0,0 +1 @@ +0.01: New Clock! diff --git a/apps/bigclkinfo/README.md b/apps/bigclkinfo/README.md new file mode 100644 index 0000000000..7cba685f12 --- /dev/null +++ b/apps/bigclkinfo/README.md @@ -0,0 +1,23 @@ +# Big Clock Info app + +For die hard clock info fans... + +## Features + +All the clock infos you have installed displayed full screen. + +## Controls + +Interact with it like one big clock info, which it is! + +## Settings + +TBA: Should the app be treated as a clock face app? + +## Requests + +Open an issue on the espruino/BangleApps issue tracker mentioning @thyttan. + +## Creator + +thyttan diff --git a/apps/bigclkinfo/app-icon.js b/apps/bigclkinfo/app-icon.js new file mode 100644 index 0000000000..f52bc45650 --- /dev/null +++ b/apps/bigclkinfo/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEw4P/AAMwwghZj/4AoYjBAgUD4ABBAoMHhOQ8AFBjlIiU4AoM4oECjgFBuYCB5wCBCgUHAQPIAQMTgEBwAFBAYMDkAuBggyBkECoAFBg0Ag1ggFggxACgdgggfDkEMPwkNFIewBYJYCmAFFhoFD2AFFC5hPB4ApHIIIFCkBNFLIILCsBrHAoZ9FRIqVGUIqtFXIrFFaIrdFdIwAVA==")) diff --git a/apps/bigclkinfo/app.js b/apps/bigclkinfo/app.js new file mode 100644 index 0000000000..853a0562b9 --- /dev/null +++ b/apps/bigclkinfo/app.js @@ -0,0 +1,38 @@ +// TODO: +// Add setting to decide if the app shoud set Bangle.CLOCK=1 ? +// Make an updating analog clock info entry to use as start card. (update clkinfoclk or make a new one?) + +let isClock = true; // TODO: make optional via setting. +if (isClock) { + Bangle.CLOCK = 1; + setWatch(() => { + Bangle.showLauncher(); + }, BTN); +} + +// Load the clock infos +let clockInfoItems = require("clock_info").load(); +// Add the +let clockInfoMenu = require("clock_info").addInteractive(clockInfoItems, { + // Add the dimensions we're rendering to here - these are used to detect taps on the clock info area + x : 0, y: 0, w: Bangle.appRect.w, h: Bangle.appRect.h, + // You can add other information here you want to be passed into 'options' in 'draw' + // This function draws the info + draw : (itm, info, options) => { + // itm: the item containing name/hasRange/etc + // info: data returned from itm.get() containing text/img/etc + // options: options passed into addInteractive + // Clear the background + g.reset().clearRect(options.x, options.y, options.x+options.w-2, options.y+options.h-1); + // indicate focus - we're using a border, but you could change color? + if (options.focus) g.drawRect(options.x, options.y, options.x+options.w-2, options.y+options.h-1); // show if focused + // we're drawing center-aligned here + var midx = options.x+options.w/2; + let scale = 5; + if (info.img) g.drawImage(info.img, midx-12*scale,options.y+4, {scale:scale}); // draw the image + g.setFont("6x8:2").setFontAlign(0,1).drawString(info.text, midx,options.y+160); // draw the text + } +}); +clockInfoMenu.menuA = 0; +if (clockInfoItems[0].items[6]) clockInfoMenu.menuB = 6; // Assume clkinfoclk is at indices (0,6) +setTimeout(clockInfoMenu.redraw,0); // Make sure correct item is set before redraw. diff --git a/apps/bigclkinfo/icon.png b/apps/bigclkinfo/icon.png new file mode 100644 index 0000000000..f4ec13e4ea Binary files /dev/null and b/apps/bigclkinfo/icon.png differ diff --git a/apps/bigclkinfo/metadata.json b/apps/bigclkinfo/metadata.json new file mode 100644 index 0000000000..fddde4b802 --- /dev/null +++ b/apps/bigclkinfo/metadata.json @@ -0,0 +1,18 @@ +{ "id": "bigclkinfo", + "name": "Big Clock Info app", + "shortName":"Big Clkinfo", + "version":"0.01", + "author": "thyttan", + "description": "One single big clock info. Full screen.", + "icon": "icon.png", + "type": "clock", + "tags": "clock,clkinfo,clk_info", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "dependencies" : { "clock_info":"module", + "clkinfoclk":"app" }, + "storage": [ + {"name":"bigclkinfo.app.js","url":"app.js"}, + {"name":"bigclkinfo.img","url":"app-icon.js","evaluate":true} + ] +}