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.02: Swiping up has now the same effect as hitting the "<" button.
|
||||
|
|
|
@ -5,7 +5,7 @@ by the JS interpreter.
|
|||
|
||||
## 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
|
||||
|
||||
|
|
|
@ -69,8 +69,8 @@ function compute() {
|
|||
var res;
|
||||
console.log(processInp(inputStr));
|
||||
try { res = eval(processInp(inputStr)); }
|
||||
catch(e) { res = "error"; }
|
||||
inputStr = res;
|
||||
catch(e) { res = "error"; }
|
||||
inputStr = res === undefined ? '' : res;
|
||||
qResult = true;
|
||||
updateDisp(inputStr, 19);
|
||||
}
|
||||
|
@ -105,6 +105,11 @@ function swipeHandler(e,d) {
|
|||
if (curPage<0) curPage = buttons.length-1;
|
||||
drawPage(curPage);
|
||||
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);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ "id": "scicalc",
|
||||
"name": "Scientific Calculator",
|
||||
"shortName":"SciCalc",
|
||||
"version":"0.01",
|
||||
"version":"0.02",
|
||||
"description": "Scientific calculator",
|
||||
"icon": "scicalc.png",
|
||||
"screenshots" : [ { "url":"scicalc_screenshot1.png" }, { "url":"scicalc_screenshot2.png" }, { "url":"scicalc_screenshot3.png" } ],
|
||||
|
|
Loading…
Reference in New Issue