mirror of https://github.com/espruino/BangleApps
0.05: setUI, screen size changes
parent
083eac0143
commit
490a0b9670
|
@ -852,9 +852,9 @@
|
||||||
{ "id": "sclock",
|
{ "id": "sclock",
|
||||||
"name": "Simple Clock",
|
"name": "Simple Clock",
|
||||||
"icon": "clock-simple.png",
|
"icon": "clock-simple.png",
|
||||||
"version":"0.04",
|
"version":"0.05",
|
||||||
"description": "A Simple Digital Clock",
|
"description": "A Simple Digital Clock",
|
||||||
"tags": "clock",
|
"tags": "clock,b2",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
"allow_emulator":true,
|
"allow_emulator":true,
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
0.02: Modified for use with new bootloader and firmware
|
0.02: Modified for use with new bootloader and firmware
|
||||||
0.03: Actually make into 24h clock since there's a 12h variant
|
0.03: Actually make into 24h clock since there's a 12h variant
|
||||||
0.04: Make this clock do 12h and 24h
|
0.04: Make this clock do 12h and 24h
|
||||||
|
0.05: setUI, screen size changes
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
/* jshint esversion: 6 */
|
/* jshint esversion: 6 */
|
||||||
const timeFontSize = 6;
|
const big = g.getWidth()>200;
|
||||||
const dateFontSize = 3;
|
const timeFontSize = big?6:5;
|
||||||
|
const dateFontSize = big?3:2;
|
||||||
const gmtFontSize = 2;
|
const gmtFontSize = 2;
|
||||||
const font = "6x8";
|
const font = "6x8";
|
||||||
|
|
||||||
const xyCenter = g.getWidth() / 2;
|
const xyCenter = g.getWidth() / 2;
|
||||||
const yposTime = 75;
|
const yposTime = xyCenter*0.6;
|
||||||
const yposDate = 130;
|
const yposDate = xyCenter*1.1;
|
||||||
const yposYear = 175;
|
const yposYear = xyCenter*1.4;
|
||||||
const yposGMT = 220;
|
const yposGMT = xyCenter*1.9;
|
||||||
|
|
||||||
// Check settings for what type our clock should be
|
// Check settings for what type our clock should be
|
||||||
var is12Hour = (require("Storage").readJSON("setting.json",1)||{})["12hour"];
|
var is12Hour = (require("Storage").readJSON("setting.json",1)||{})["12hour"];
|
||||||
|
@ -77,5 +78,5 @@ setInterval(drawSimpleClock, 15E3);
|
||||||
// draw now
|
// draw now
|
||||||
drawSimpleClock();
|
drawSimpleClock();
|
||||||
|
|
||||||
// Show launcher when middle button pressed
|
// Show launcher when button pressed
|
||||||
setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"});
|
Bangle.setUI("clock");
|
||||||
|
|
Loading…
Reference in New Issue