mirror of https://github.com/espruino/BangleApps
add configuration for text direction
parent
7ad0ca6acb
commit
8bfce14000
18
apps.json
18
apps.json
|
@ -1944,26 +1944,16 @@
|
||||||
"id": "largeclock",
|
"id": "largeclock",
|
||||||
"name": "Large Clock",
|
"name": "Large Clock",
|
||||||
"icon": "largeclock.png",
|
"icon": "largeclock.png",
|
||||||
"version": "0.09",
|
"version": "0.10",
|
||||||
"description": "A readable and informational digital watch, with date, seconds and moon phase",
|
"description": "A readable and informational digital watch, with date, seconds and moon phase",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"allow_emulator": true,
|
"allow_emulator": true,
|
||||||
"storage": [
|
"storage": [
|
||||||
{
|
{"name": "largeclock.app.js", "url": "largeclock.js"},
|
||||||
"name": "largeclock.app.js",
|
{"name": "largeclock.img", "url": "largeclock-icon.js", "evaluate": true},
|
||||||
"url": "largeclock.js"
|
{"name": "largeclock.settings.js", "url": "settings.js"}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "largeclock.img",
|
|
||||||
"url": "largeclock-icon.js",
|
|
||||||
"evaluate": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "largeclock.settings.js",
|
|
||||||
"url": "settings.js"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"data": [
|
"data": [
|
||||||
{"name":"largeclock.json"}
|
{"name":"largeclock.json"}
|
||||||
|
|
|
@ -7,3 +7,4 @@
|
||||||
0.07: Don't clear all intervals during initialisation
|
0.07: Don't clear all intervals during initialisation
|
||||||
0.08: Use Bangle.setUI for button/launcher handling
|
0.08: Use Bangle.setUI for button/launcher handling
|
||||||
0.09: fix font size for latest firmwares
|
0.09: fix font size for latest firmwares
|
||||||
|
0.10: Configure the side text direction based on the wrist on which you wear your watch
|
||||||
|
|
|
@ -7,6 +7,7 @@ A readable and informational digital watch, with date, seconds and moon phase an
|
||||||
- Readable
|
- Readable
|
||||||
- Informative: hours, minutes, secondsa, date, year and moon phase
|
- Informative: hours, minutes, secondsa, date, year and moon phase
|
||||||
- Pairs nicely with any other apps: in setting > large clock any installed app can be assigned to BTN1 and BTN3 in order to open it easily directly from the watch, without the hassle of passing trough the launcher. For example BTN1 can be assigned to alarm and BTN3 to chronometer.
|
- Pairs nicely with any other apps: in setting > large clock any installed app can be assigned to BTN1 and BTN3 in order to open it easily directly from the watch, without the hassle of passing trough the launcher. For example BTN1 can be assigned to alarm and BTN3 to chronometer.
|
||||||
|
- Configure the text direction on the side depending on the wrist on which you wear your watch.
|
||||||
|
|
||||||
## How to use it
|
## How to use it
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,9 @@ const settings = require("Storage").readJSON("largeclock.json", 1)||{};
|
||||||
const BTN1app = settings.BTN1 || "";
|
const BTN1app = settings.BTN1 || "";
|
||||||
const BTN3app = settings.BTN3 || "";
|
const BTN3app = settings.BTN3 || "";
|
||||||
|
|
||||||
|
const right_hand = (require("Storage").readJSON("largeclock.json",1)||{}).right_hand;
|
||||||
|
const rotation = right_hand ? 3 : 1;
|
||||||
|
|
||||||
function drawMoon(d) {
|
function drawMoon(d) {
|
||||||
const BLACK = 0,
|
const BLACK = 0,
|
||||||
MOON = 0x41f,
|
MOON = 0x41f,
|
||||||
|
@ -145,9 +148,9 @@ function drawTime(d) {
|
||||||
g.setColor(1, 50, 1);
|
g.setColor(1, 50, 1);
|
||||||
g.drawString(minutes, 40, 130, true);
|
g.drawString(minutes, 40, 130, true);
|
||||||
g.setFont("Vector", 20);
|
g.setFont("Vector", 20);
|
||||||
g.setRotation(3);
|
g.setRotation(rotation);
|
||||||
g.drawString(`${dow} ${day} ${month}`, 60, 10, true);
|
g.drawString(`${dow} ${day} ${month}`, 60, right_hand?10:205, true);
|
||||||
g.drawString(year, is12Hour ? 46 : 75, 205, true);
|
g.drawString(year, is12Hour?(right_hand?56:120):(right_hand?85:115), right_hand?205:10, true);
|
||||||
lastMinutes = minutes;
|
lastMinutes = minutes;
|
||||||
}
|
}
|
||||||
g.setRotation(0);
|
g.setRotation(0);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
"BTN1": "",
|
"BTN1": "",
|
||||||
"BTN3": ""
|
"BTN3": "",
|
||||||
|
"right_hand": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
|
|
||||||
const settings = s.readJSON("largeclock.json", 1) || {
|
const settings = s.readJSON("largeclock.json", 1) || {
|
||||||
BTN1: "",
|
BTN1: "",
|
||||||
BTN3: ""
|
BTN3: "",
|
||||||
|
right_hand: false
|
||||||
};
|
};
|
||||||
|
|
||||||
function showApps(btn) {
|
function showApps(btn) {
|
||||||
|
@ -67,10 +68,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const mainMenu = {
|
const mainMenu = {
|
||||||
"": { title: "Large Clock Settings" },
|
"": { title: "Large Clock" },
|
||||||
"< Back": back,
|
"< Back": back,
|
||||||
"BTN1 app": () => showApps("BTN1"),
|
"BTN1 app": () => showApps("BTN1"),
|
||||||
"BTN3 app": () => showApps("BTN3")
|
"BTN3 app": () => showApps("BTN3"),
|
||||||
|
"On right hand": {
|
||||||
|
value: !!settings.right_hand,
|
||||||
|
format: v=>v?"Yes":"No",
|
||||||
|
onchange: v=>{
|
||||||
|
settings.right_hand = v;
|
||||||
|
s.writeJSON("largeclock.json", settings);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
E.showMenu(mainMenu);
|
E.showMenu(mainMenu);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue