Allow scrolling to wrap around (fix #382)
parent
0dbbce2134
commit
87cf91d80e
|
|
@ -41,7 +41,7 @@
|
||||||
"name": "Default Launcher",
|
"name": "Default Launcher",
|
||||||
"shortName":"Launcher",
|
"shortName":"Launcher",
|
||||||
"icon": "app.png",
|
"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.",
|
"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",
|
"tags": "tool,system,launcher",
|
||||||
"type":"launch",
|
"type":"launch",
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
0.02: Only store relevant app data (saves RAM when many apps)
|
0.02: Only store relevant app data (saves RAM when many apps)
|
||||||
|
0.03: Allow scrolling to wrap around (fix #382)
|
||||||
|
|
|
||||||
|
|
@ -40,16 +40,14 @@ function drawMenu() {
|
||||||
}
|
}
|
||||||
drawMenu();
|
drawMenu();
|
||||||
setWatch(function() {
|
setWatch(function() {
|
||||||
if (selected>0) {
|
|
||||||
selected--;
|
selected--;
|
||||||
|
if (selected<0) selected = apps.length-1;
|
||||||
drawMenu();
|
drawMenu();
|
||||||
}
|
|
||||||
}, BTN1, {repeat:true});
|
}, BTN1, {repeat:true});
|
||||||
setWatch(function() {
|
setWatch(function() {
|
||||||
if (selected+1<apps.length) {
|
|
||||||
selected++;
|
selected++;
|
||||||
|
if (selected>=apps.length) selected = 0;
|
||||||
drawMenu();
|
drawMenu();
|
||||||
}
|
|
||||||
}, BTN3, {repeat:true});
|
}, BTN3, {repeat:true});
|
||||||
setWatch(function() { // run
|
setWatch(function() { // run
|
||||||
if (!apps[selected].src) return;
|
if (!apps[selected].src) return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue