mirror of https://github.com/espruino/BangleApps
swiperclocklaunch: fix detection of clock
parent
3211cf6955
commit
14a37529c9
|
@ -4,3 +4,4 @@
|
|||
0.04: Update to work with new 'fast switch' clock->launcher functionality
|
||||
0.05: Keep track of event listeners we "overwrite", and remove them at the start of setUI
|
||||
0.06: Handle apps that call setUI({}) to reset
|
||||
0.07: Use a more reliable method of detecting a clock
|
||||
|
|
|
@ -8,19 +8,14 @@
|
|||
sui(mode,cb);
|
||||
oldSwipe = Bangle.swipeHandler;
|
||||
|
||||
if ("object"==typeof mode) mode = mode.mode;
|
||||
if (!mode) return;
|
||||
|
||||
if (mode.startsWith("clock")) {
|
||||
if (Bangle.CLOCK) {
|
||||
// clock -> launcher
|
||||
Bangle.swipeHandler = dir => { if (dir<0) Bangle.showLauncher(); };
|
||||
Bangle.on("swipe", Bangle.swipeHandler);
|
||||
} else {
|
||||
if (global.__FILE__ && __FILE__.endsWith(".app.js") && (require("Storage").readJSON(__FILE__.slice(0,-6)+"info",1)||{}).type=="launch") {
|
||||
} else if (global.__FILE__ && __FILE__.endsWith(".app.js") && (require("Storage").readJSON(__FILE__.slice(0,-6)+"info",1)||{}).type==="launch") {
|
||||
// launcher -> clock
|
||||
Bangle.swipeHandler = dir => { if (dir>0) load(); };
|
||||
Bangle.on("swipe", Bangle.swipeHandler);
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "swiperclocklaunch",
|
||||
"name": "Swiper Clock Launch",
|
||||
"version": "0.06",
|
||||
"version": "0.07",
|
||||
"description": "Navigate between clock and launcher with Swipe action",
|
||||
"icon": "swiperclocklaunch.png",
|
||||
"type": "bootloader",
|
||||
|
|
Loading…
Reference in New Issue