Update app.js

Fix onTouch while timerRunning. Previously briefly showed timer picker numbers.
master
sir-indy 2022-05-03 12:30:50 +01:00 committed by GitHub
parent 0a93ea7c00
commit fd5e0bf45c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 10 deletions

View File

@ -50,20 +50,24 @@ function onTouch(button, xy) {
var touchMidpoint = timePickerLayout.hours.y + timePickerLayout.hours.h/2;
var diff = 0;
Bangle.buzz(40, 0.3);
if (!timerRunning() && xy.y > 24 && xy.y < touchMidpoint - 10) {
diff = 1;
} else if (!timerRunning() && xy.y > touchMidpoint + 10 && xy.y < timePickerLayout.btnStart.y) {
diff = -1;
} else if (xy.y > timePickerLayout.btnStart.y) {
if (xy.y > timePickerLayout.btnStart.y) {
onButton();
return;
}
if (xy.x < timePickerLayout.hours.w) {
diff *= 3600;
} else if (xy.x > timePickerLayout.mins.x && xy.x < timePickerLayout.secs.x) {
diff *= 60;
if (!timerRunning()) {
if (&& xy.y > 24 && xy.y < touchMidpoint - 10) {
diff = 1;
} else if (&& xy.y > touchMidpoint + 10 && xy.y < timePickerLayout.btnStart.y) {
diff = -1;
}
if (xy.x < timePickerLayout.hours.w) {
diff *= 3600;
} else if (xy.x > timePickerLayout.mins.x && xy.x < timePickerLayout.secs.x) {
diff *= 60;
}
updateTimePicker(diff);
}
updateTimePicker(diff);
}
function onButton() {