Merge pull request #2959 from inhof009/master

USGS v0.02
master
Gordon Williams 2023-08-09 13:43:34 +01:00 committed by GitHub
commit 51363a88bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 5 deletions

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Changed menu names, added button interaction.

View File

@ -26,7 +26,7 @@ Simple interface will display most current data for the specified location when
## Controls
No controls currently
Press button (middle on Bangle 1) once to refresh data, twice to return to launcher.
## Creator

View File

@ -63,5 +63,27 @@ function displayData(dataStreams) {
seconds.toString().padStart(2,"0");
E.showMessage(string,timeString);
}
function handleButton() {
switch(nPress) {
case 1:
fetchStartup();
break;
case 2:
Bangle.showLauncher();
break;
default:
Bangle.buzz(50);
}
nPress=0;
}
fetchStartup();
nPress = 0;
tPress = 0;
setWatch(() => {
nPress++;
clearTimeout(tPress);
tPress = setTimeout(() => {handleButton();}, 500);
}, (process.env.HWVERSION==2) ? BTN1 : BTN2, {repeat: true, edge: "rising"});

View File

@ -1,7 +1,7 @@
{ "id": "usgs",
"name": "USGS Data fetching app",
"shortName":"USGS",
"version":"0.01",
"version":"0.02",
"description": "App that fetches [USGS water data](https://maps.waterdata.usgs.gov/) for a configurable location (requires connection to Android phone)",
"icon": "app.png",
"tags": "outdoors,exercise,http",

View File

@ -9,7 +9,7 @@
var submenu = {
"" : {
"title" : "-- DataStreams --"
"title" : "DataStreams"
},
"< Back" : function() { E.showMenu(menu); },
};
@ -38,7 +38,7 @@ function popSubMenuData(data) {
E.showMenu(submenu);
}
var menu = {
"" : { "title" : "App Name" },
"" : { "title" : "USGS" },
"< Back" : () => back(),
'Temp unit': {
value: !!settings.tempUnitF, // !! converts undefined to false
@ -59,7 +59,7 @@ function popSubMenuData(data) {
}, 100);
}
},
"Submenu" : function() { popSubMenu();},
"DataStreams" : function() { popSubMenu();},
};
var keyboard = "textinput";