BangleApps/apps/kitchen/swatch.kit.js

44 lines
824 B
JavaScript
Raw Normal View History

2021-04-14 21:54:01 +00:00
(() => {
function getFace(){
let swObject = undefined;
function init(gps, sw, hrm) {
2021-04-14 21:54:01 +00:00
swObject = sw;
g.clear();
}
function freeResources() {}
2021-04-14 21:54:01 +00:00
function startTimer() {
swObject.startTimer();
}
function stopTimer() {
swObject.stopTimer();
}
function onButtonShort(btn) {
switch (btn) {
case 1:
swObject.stopStart();
break;
case 2:
swObject.lapOrReset();
break;
case 3:
default:
return;
}
}
function onButtonLong(btn) {
if (btn === 2) Bangle.showLauncher();
}
2021-04-14 21:54:01 +00:00
return {init:init, freeResources:freeResources, startTimer:startTimer, stopTimer:stopTimer,
onButtonShort:onButtonShort, onButtonLong:onButtonLong};
}
return getFace;
})();