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.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.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.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);
|
sui(mode,cb);
|
||||||
oldSwipe = Bangle.swipeHandler;
|
oldSwipe = Bangle.swipeHandler;
|
||||||
|
|
||||||
if ("object"==typeof mode) mode = mode.mode;
|
if (Bangle.CLOCK) {
|
||||||
if (!mode) return;
|
|
||||||
|
|
||||||
if (mode.startsWith("clock")) {
|
|
||||||
// clock -> launcher
|
// clock -> launcher
|
||||||
Bangle.swipeHandler = dir => { if (dir<0) Bangle.showLauncher(); };
|
Bangle.swipeHandler = dir => { if (dir<0) Bangle.showLauncher(); };
|
||||||
Bangle.on("swipe", Bangle.swipeHandler);
|
Bangle.on("swipe", Bangle.swipeHandler);
|
||||||
} else {
|
} else if (global.__FILE__ && __FILE__.endsWith(".app.js") && (require("Storage").readJSON(__FILE__.slice(0,-6)+"info",1)||{}).type==="launch") {
|
||||||
if (global.__FILE__ && __FILE__.endsWith(".app.js") && (require("Storage").readJSON(__FILE__.slice(0,-6)+"info",1)||{}).type=="launch") {
|
// launcher -> clock
|
||||||
// launcher -> clock
|
Bangle.swipeHandler = dir => { if (dir>0) load(); };
|
||||||
Bangle.swipeHandler = dir => { if (dir>0) load(); };
|
Bangle.on("swipe", Bangle.swipeHandler);
|
||||||
Bangle.on("swipe", Bangle.swipeHandler);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "swiperclocklaunch",
|
"id": "swiperclocklaunch",
|
||||||
"name": "Swiper Clock Launch",
|
"name": "Swiper Clock Launch",
|
||||||
"version": "0.06",
|
"version": "0.07",
|
||||||
"description": "Navigate between clock and launcher with Swipe action",
|
"description": "Navigate between clock and launcher with Swipe action",
|
||||||
"icon": "swiperclocklaunch.png",
|
"icon": "swiperclocklaunch.png",
|
||||||
"type": "bootloader",
|
"type": "bootloader",
|
||||||
|
|
Loading…
Reference in New Issue