forked from FOSS/BangleApps
launch - Use Bangle.showClock
parent
dc219416eb
commit
bc28900e60
|
@ -19,3 +19,4 @@
|
|||
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
|
||||
0.19: Fix regression after back button added (returnToClock was called twice!)
|
||||
0.20: Use Bangle.showClock for changing to clock
|
||||
|
|
|
@ -42,16 +42,6 @@ let apps = launchCache.apps;
|
|||
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) => {
|
||||
|
@ -74,7 +64,12 @@ E.showScroller({
|
|||
load(app.src);
|
||||
}
|
||||
},
|
||||
back : returnToClock // button press or tap in top left calls returnToClock now
|
||||
back : Bangle.showClock, // button press or tap in top left shows clock now
|
||||
remove : () => {
|
||||
// cleanup the timeout to not leave anything behind after being removed from ram
|
||||
if (lockTimeout) clearTimeout(lockTimeout);
|
||||
Bangle.removeListener("lock", lockHandler);
|
||||
}
|
||||
});
|
||||
g.flip(); // force a render before widgets have finished drawing
|
||||
|
||||
|
@ -85,7 +80,7 @@ let lockHandler = function(locked) {
|
|||
if (lockTimeout) clearTimeout(lockTimeout);
|
||||
lockTimeout = undefined;
|
||||
if (locked)
|
||||
lockTimeout = setTimeout(returnToClock, 10000);
|
||||
lockTimeout = setTimeout(Bangle.showClock, 10000);
|
||||
}
|
||||
Bangle.on("lock", lockHandler);
|
||||
if (!settings.fullscreen) // finally draw widgets
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "launch",
|
||||
"name": "Launcher",
|
||||
"shortName": "Launcher",
|
||||
"version": "0.19",
|
||||
"version": "0.20",
|
||||
"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",
|
||||
|
|
Loading…
Reference in New Issue