1
0
Fork 0

final release fixes

master
jeffmer 2021-11-01 20:38:22 +00:00
parent 33763110cc
commit 4e331e58cf
4 changed files with 13 additions and 32 deletions

View File

@ -2684,7 +2684,7 @@
"id": "multiclock", "id": "multiclock",
"name": "Multi Clock", "name": "Multi Clock",
"version": "0.07", "version": "0.07",
"description": "Clock with multiple faces - Big, Analogue, Digital, Text, Time-Date.\n Switch between faces with BTN1 & BTN3", "description": "Clock with multiple faces. Switch between faces with BTN1 & BTN3 or swipe left-right. For best display set theme Background 2 to cyan or some other bright colour in settings.",
"icon": "multiclock.png", "icon": "multiclock.png",
"type": "clock", "type": "clock",
"tags": "clock", "tags": "clock",

View File

@ -1,29 +1,11 @@
# Multiclock # Multiclock
This is a clock app that supports multiple clock faces. The user can switch between faces while retaining widget state which makes the switch fast. Currently there are four clock faces as shown below. This is a clock app that supports multiple clock faces. The user can switch between faces while retaining widget state which makes the switch fast. Currently there are four clock faces as shown below. There are currently an anlog, digital, text, big digit, time and date, and a clone of the Nifty-A-Clock faces.
### Analog Clock Face ### Analog Clock Face
### Digital Clock Face
### Big Digit Clock Face
### Text Clock Face
### Time and Date Clock Face
## Controls ## Controls
Clock faces are kept in a circular list. Swipe left and right on both the Bangle and Bangle 2 switch between faces. BTN1 & BTH3 also switch faces on the Bangle.
*BTN1* - switches to the next clock face.
*BTN2* - switches to the app launcher.
*BTN3* - switches to the previous clock face.
## Adding a new face ## Adding a new face
Clock faces are described in javascript storage files named `name.face.js`. For example, the Analog Clock Face is described in `ana.face.js`. These files have the following structure: Clock faces are described in javascript storage files named `name.face.js`. For example, the Analog Clock Face is described in `ana.face.js`. These files have the following structure:
@ -37,7 +19,7 @@ Clock faces are described in javascript storage files named `name.face.js`. For
function drawAll(){ function drawAll(){
//draw background + initial state of digits, hands etc //draw background + initial state of digits, hands etc
} }
return {init:drawAll, tick:onSecond}; return {init:drawAll, tick:onSecond, tickpersec:true};
} }
return getFace; return getFace;
})(); })();
@ -46,6 +28,5 @@ For those familiar with the structure of widgets, this is similar, however, ther
The app at start up loads all files `*.face.js`. The simplest way of adding a face is thus to load it into `Storage` using the WebIDE. Similarly, to remove an unwanted face, simply delete it from `Storage` using the WebIDE. The app at start up loads all files `*.face.js`. The simplest way of adding a face is thus to load it into `Storage` using the WebIDE. Similarly, to remove an unwanted face, simply delete it from `Storage` using the WebIDE.
## Support If `tickpersec` is false then `tick` is only called each minute as this is more power effcient - especially on the BAngle 2.
Please report bugs etc. by raising an issue [here](https://github.com/jeffmer/JeffsBangleAppsDev).

View File

@ -9,7 +9,7 @@ function getFace(){
var buf = Graphics.createArrayBuffer(W,92,1,{msb:true}); var buf = Graphics.createArrayBuffer(W,92,1,{msb:true});
function flip() { function flip() {
g.setColor(g.theme.fg); g.setColor(g.theme.fg);
g.drawImage({width:buf.getWidth(),height:buf.getHeight(),buffer:buf.buffer},0,H/2-46); g.drawImage({width:buf.getWidth(),height:buf.getHeight(),buffer:buf.buffer},0,H/2-34);
} }
var W = g.getWidth(); var W = g.getWidth();
@ -24,10 +24,10 @@ function getFace(){
buf.setFont("Vector",54*scale); buf.setFont("Vector",54*scale);
buf.setFontAlign(0,-1); buf.setFontAlign(0,-1);
buf.drawString(time,W/2,0); buf.drawString(time,W/2,0);
buf.setFont("6x8",2); buf.setFont("6x8",scale<1?1:2);
buf.setFontAlign(0,-1); buf.setFontAlign(0,-1);
var date = d.toString().substr(0,15); var date = d.toString().substr(0,15);
buf.drawString(date, W/2, 70); buf.drawString(date, W/2, 70*scale);
flip(); flip();
} }
return {init:drawTime, tick:drawTime, tickpersec:true}; return {init:drawTime, tick:drawTime, tickpersec:true};

View File

@ -23,17 +23,17 @@
var d = new Date(); var d = new Date();
g.setColor(g.theme.fg); g.setColor(g.theme.fg);
g.setFontAlign(0,0); g.setFontAlign(0,0);
g.setFont("Vector",44); g.setFont("Vector",F);
var txt = convert(d.getHours()); var txt = convert(d.getHours());
g.setColor(g.theme.fg); g.setColor(g.theme.fg);
g.drawString(txt.top,W/2,H/2-2*F); g.drawString(txt.top,W/2,H/2+24-2*F);
g.setColor(g.theme.fg2); g.setColor(g.theme.fg2);
g.drawString(txt.bot,W/2,H/2-F); g.drawString(txt.bot,W/2,H/2+24-F);
txt = convert(d.getMinutes()); txt = convert(d.getMinutes());
g.setColor(g.theme.fg); g.setColor(g.theme.fg);
g.drawString(txt.top,W/2,H/2); g.drawString(txt.top,W/2,H/2+24);
g.setColor(g.theme.fg2); g.setColor(g.theme.fg2);
g.drawString(txt.bot,W/2,H/2+F); g.drawString(txt.bot,W/2,H/2+24+F);
} }