mirror of https://github.com/espruino/BangleApps
scicalc: Add swipe up action
Swiping up has now the same effect as hitting the "<" button.pull/3054/head
parent
c8ef7097c0
commit
1500e68011
|
@ -1 +1,2 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
|
0.02: Swiping up has now the same effect as hitting the "<" button.
|
||||||
|
|
|
@ -5,7 +5,7 @@ by the JS interpreter.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Buttons are arranged on 3 separate screens, swiping left or right switches between them. Swiping down has the same effect as hitting the "=" button.
|
Buttons are arranged on 3 separate screens, swiping left or right switches between them. Swiping down has the same effect as hitting the "=" button. Swiping up has the same effect as hitting the "<" button.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ function compute() {
|
||||||
console.log(processInp(inputStr));
|
console.log(processInp(inputStr));
|
||||||
try { res = eval(processInp(inputStr)); }
|
try { res = eval(processInp(inputStr)); }
|
||||||
catch(e) { res = "error"; }
|
catch(e) { res = "error"; }
|
||||||
inputStr = res;
|
inputStr = res === undefined ? '' : res;
|
||||||
qResult = true;
|
qResult = true;
|
||||||
updateDisp(inputStr, 19);
|
updateDisp(inputStr, 19);
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,11 @@ function swipeHandler(e,d) {
|
||||||
if (curPage<0) curPage = buttons.length-1;
|
if (curPage<0) curPage = buttons.length-1;
|
||||||
drawPage(curPage);
|
drawPage(curPage);
|
||||||
if (d==1) compute();
|
if (d==1) compute();
|
||||||
|
else if (d==-1) {
|
||||||
|
if (inputStr.length>0) inputStr = inputStr.slice(0, -1); // delete last character
|
||||||
|
qResult = false;
|
||||||
|
updateDisp(inputStr, 32);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Bangle.on("touch", touchHandler);
|
Bangle.on("touch", touchHandler);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ "id": "scicalc",
|
{ "id": "scicalc",
|
||||||
"name": "Scientific Calculator",
|
"name": "Scientific Calculator",
|
||||||
"shortName":"SciCalc",
|
"shortName":"SciCalc",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "Scientific calculator",
|
"description": "Scientific calculator",
|
||||||
"icon": "scicalc.png",
|
"icon": "scicalc.png",
|
||||||
"screenshots" : [ { "url":"scicalc_screenshot1.png" }, { "url":"scicalc_screenshot2.png" }, { "url":"scicalc_screenshot3.png" } ],
|
"screenshots" : [ { "url":"scicalc_screenshot1.png" }, { "url":"scicalc_screenshot2.png" }, { "url":"scicalc_screenshot3.png" } ],
|
||||||
|
|
Loading…
Reference in New Issue