launcher 0.18: Add 'back' icon in top-left to go back to clock

pull/2232/head
Gordon Williams 2022-11-04 14:10:03 +00:00
parent 69dbac6128
commit 73cbbb21df
3 changed files with 16 additions and 11 deletions

View File

@ -17,3 +17,4 @@
0.15: Support for unload and quick return to the clock on 2v16
0.16: Use a cache of app.info files to speed up loading the launcher
0.17: Don't display 'Loading...' now the watch has its own loading screen
0.18: Add 'back' icon in top-left to go back to clock

View File

@ -41,6 +41,17 @@ let apps = launchCache.apps;
// Now apps list is loaded - render
if (!settings.fullscreen)
Bangle.loadWidgets();
let returnToClock = function() {
// unload everything manually
// ... or we could just call `load();` but it will be slower
Bangle.setUI(); // remove scroller's handling
if (lockTimeout) clearTimeout(lockTimeout);
Bangle.removeListener("lock", lockHandler);
// now load the default clock - just call .bootcde as this has the code already
setTimeout(eval,0,s.read(".bootcde"));
}
E.showScroller({
h : 64*scaleval, c : apps.length,
draw : (i, r) => {
@ -62,19 +73,12 @@ E.showScroller({
} else {
load(app.src);
}
}
},
back : returnToClock
});
g.flip(); // force a render before widgets have finished drawing
let returnToClock = function() {
// unload everything manually
// ... or we could just call `load();` but it will be slower
Bangle.setUI(); // remove scroller's handling
if (lockTimeout) clearTimeout(lockTimeout);
Bangle.removeListener("lock", lockHandler);
// now load the default clock - just call .bootcde as this has the code already
setTimeout(eval,0,s.read(".bootcde"));
}
// on bangle.js 2, the screen is used for navigating, so the single button goes back
// on bangle.js 1, the buttons are used for navigating

View File

@ -2,7 +2,7 @@
"id": "launch",
"name": "Launcher",
"shortName": "Launcher",
"version": "0.17",
"version": "0.18",
"description": "This is needed to display a menu allowing you to choose your own applications. You can replace this with a customised launcher.",
"readme": "README.md",
"icon": "app.png",