Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/bigclkinfo/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.01: New Clock!
23 changes: 23 additions & 0 deletions apps/bigclkinfo/README.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions apps/bigclkinfo/app-icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions apps/bigclkinfo/app.js
Original file line number Diff line number Diff line change
@@ -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.
Binary file added apps/bigclkinfo/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions apps/bigclkinfo/metadata.json
Original file line number Diff line number Diff line change
@@ -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}
]
}