Allow scrolling to wrap around (fix #382)

pull/383/head
Gordon Williams 2020-05-05 11:39:21 +01:00
parent 0dbbce2134
commit 87cf91d80e
3 changed files with 8 additions and 9 deletions

View File

@ -41,7 +41,7 @@
"name": "Default Launcher",
"shortName":"Launcher",
"icon": "app.png",
"version":"0.02",
"version":"0.03",
"description": "This is needed by Bangle.js to display a menu allowing you to choose your own applications. You can replace this with a customised launcher.",
"tags": "tool,system,launcher",
"type":"launch",

View File

@ -1,2 +1,3 @@
0.01: New App!
0.02: Only store relevant app data (saves RAM when many apps)
0.03: Allow scrolling to wrap around (fix #382)

View File

@ -40,16 +40,14 @@ function drawMenu() {
}
drawMenu();
setWatch(function() {
if (selected>0) {
selected--;
if (selected<0) selected = apps.length-1;
drawMenu();
}
}, BTN1, {repeat:true});
setWatch(function() {
if (selected+1<apps.length) {
selected++;
if (selected>=apps.length) selected = 0;
drawMenu();
}
}, BTN3, {repeat:true});
setWatch(function() { // run
if (!apps[selected].src) return;