mirror of https://github.com/espruino/BangleApps
Merge pull request #2374 from pebl-hank/master
Reverted changes to implementation of 0.25pull/2377/head^2
commit
a808b1a87d
|
@ -11,3 +11,4 @@
|
|||
0.25: Minor code optimization
|
||||
0.26: BJS2: Swipe down to rotate 180 degree
|
||||
0.27: BJS2: Changed swipe down to swipe up
|
||||
0.28: Reverted changes to implementation of 0.25
|
||||
|
|
|
@ -14,8 +14,6 @@ Provide names and the UTC offsets for up to three other timezones in the app sto
|
|||
|
||||
The clock does not handle summer time / daylight saving time changes automatically. If one of your three locations changes its UTC offset, you can simply change the setting in the app store and update. Currently the clock only supports 24 hour time format for the additional time zones.
|
||||
|
||||
BangleJS2: Swipe up to rotate screen. So you can show the time to a friend real quick.
|
||||
|
||||
## Requests
|
||||
|
||||
Please use [the Espruino Forum](http://forum.espruino.com/microcosms/1424/) if you have feature requests or notice bugs.
|
||||
|
|
|
@ -7,7 +7,6 @@ var showSunInfo;
|
|||
var colorWhenDark;
|
||||
// ------- Settings file
|
||||
|
||||
const BANGLEJS2 = process.env.HWVERSION == 2;
|
||||
const big = g.getWidth()>200;
|
||||
// Font for primary time and date
|
||||
const primaryTimeFontSize = big?6:5;
|
||||
|
@ -25,7 +24,6 @@ const xcol1 = 10;
|
|||
const xcol2 = g.getWidth() - xcol1;
|
||||
|
||||
const font = "6x8";
|
||||
let drag;
|
||||
|
||||
/* TODO: we could totally use 'Layout' here and
|
||||
avoid a whole bunch of hard-coded offsets */
|
||||
|
@ -319,54 +317,6 @@ Bangle.drawWidgets();
|
|||
draw();
|
||||
|
||||
|
||||
|
||||
function initDragEvents() {
|
||||
|
||||
if (BANGLEJS2) {
|
||||
Bangle.on("drag", e => {
|
||||
if (!drag) { // start dragging
|
||||
drag = {x: e.x, y: e.y};
|
||||
} else if (!e.b) { // released
|
||||
const dx = e.x-drag.x, dy = e.y-drag.y;
|
||||
drag = null;
|
||||
if (Math.abs(dx)>Math.abs(dy)+10) {
|
||||
// horizontal
|
||||
if (dx < dy) {
|
||||
// for later purpose
|
||||
} else {
|
||||
// for later purpose
|
||||
}
|
||||
} else if (Math.abs(dy)>Math.abs(dx)+10) {
|
||||
// vertical
|
||||
if (dx < dy) { //down
|
||||
g.clear().setRotation(0);
|
||||
draw();
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
} else {
|
||||
g.clear().setRotation(2);
|
||||
draw();
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
}
|
||||
} else {
|
||||
//console.log("tap " + e.x + " " + e.y);
|
||||
if (e.x > 145 && e.y > 145) {
|
||||
// for later purpose
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//setWatch(xxx, BTN1, { repeat: true, debounce:50 }); // maybe adding this later
|
||||
//setWatch(xxx, BTN3, { repeat: true, debounce:50 });
|
||||
//setWatch(xxx, BTN4, { repeat: true, debounce:50 });
|
||||
//setWatch(xxx, BTN5, { repeat: true, debounce:50 });
|
||||
}
|
||||
}
|
||||
|
||||
initDragEvents();
|
||||
|
||||
if (!Bangle.isLocked()) { // Initial state
|
||||
if (showSunInfo) {
|
||||
if (PosInterval != 0 && typeof PosInterval != 'undefined') clearInterval(PosInterval);
|
||||
|
@ -400,6 +350,7 @@ if (!Bangle.isLocked()) { // Initial state
|
|||
updatePos();
|
||||
}
|
||||
draw(); // draw immediately, queue redraw
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "hworldclock",
|
||||
"name": "Hanks World Clock",
|
||||
"shortName": "Hanks World Clock",
|
||||
"version": "0.27",
|
||||
"version": "0.28",
|
||||
"description": "Current time zone plus up to three others",
|
||||
"allow_emulator":true,
|
||||
"icon": "app.png",
|
||||
|
|
Loading…
Reference in New Issue