diff --git a/apps.json b/apps.json index 0a537d676..51b17e7f5 100644 --- a/apps.json +++ b/apps.json @@ -5075,8 +5075,7 @@ "readme": "README.md", "storage": [ { "name": "swp2clk.boot.js", "url": "boot.js" }, - {"name":"swp2clk.settings.js","url":"settings.js"}, - { "name": "swp2clk.img", "url": "app-icon.js", "evaluate": true } + {"name":"swp2clk.settings.js","url":"settings.js"} ], "data": [{"name":"swp2clk.data.json"}] } diff --git a/apps/swp2clk/README.md b/apps/swp2clk/README.md index f6d0dd2b4..877a13ecc 100644 --- a/apps/swp2clk/README.md +++ b/apps/swp2clk/README.md @@ -9,4 +9,14 @@ The swipe modes can be configured in the settings app, under "Swipe to Clock". - Always Off: Deactivated for all apps (Default) - White List: Only activate for chosen apps, otherwise deactivated for all apps. - Black List: Only disabled for chosen apps, otherwise activated for all apps. -- Always On: Active for all apps (Not actually recommended! E.g. Games need to be able to deal with swipe gestures) \ No newline at end of file +- Always On: Active for all apps (Not actually recommended! E.g. Games need to be able to deal with swipe gestures) + +## Motivation: + +The goal is to further support touch-only usage of the BangleJS 2 watch. You can use the [Swiper Clock Launch](https://banglejs.com/apps/#swiper%20clock%20launch) or the [Pattern Launcher](https://banglejs.com/apps/#pattern%20launcher) to further enable touch-only support of the watch. + +## Credits: + +Initial creation: [crazysaem](https://github.com/crazysaem) + +Inspired by: [Swiper Clock Launch](https://banglejs.com/apps/#swiper%20clock%20launch) \ No newline at end of file diff --git a/apps/swp2clk/app-icon.js b/apps/swp2clk/app-icon.js deleted file mode 100644 index e59cd6244..000000000 --- a/apps/swp2clk/app-icon.js +++ /dev/null @@ -1 +0,0 @@ -require("heatshrink").decompress(atob("mEwwkE/4A2+cyiJABiMjn4WPiAVCDIUBDBsyiEBiUzAwMzkIHBl4tMBw/yBIIxKkIME+YEEiESIpMBkYGD+MfKQoMEEQcgiYHE+EPAwkxgRJG+RSGC4xJBNYwuGC44wCD4sRG4wXHCAweGC5JABQAhGHC5IpFiDIHC5HzgIEHC5oqE+JeHC5RgDmBkEC5vxgYXZkDdGC5fyLYSOIC5SLDC5MgQJAXDUxHygEAKREQC5XxC4KCIC8xHLO4/ziERiSPTmI4IC4rXGFwMTC5LXDmBsFFwLHINQUDC44uH+fc54XG+LlE+QuFnvM5gXDkArCMYYFCkYsECwIAHSBIsDC5cgLIoVMC4ZgFC6PziJIFLpYXDJA53PUY6nHZQMvEwwwIa4kxgQmHmUBXoYMHiAMJkJJJIoMSEZIMBgJTG+QJBERAOFiUzAwMzkIgIGJEAgERiIDBFpgYEmQVCiMjCx4AoA=")) \ No newline at end of file diff --git a/apps/swp2clk/app.pdn b/apps/swp2clk/app.pdn deleted file mode 100644 index 60baf6cab..000000000 Binary files a/apps/swp2clk/app.pdn and /dev/null differ diff --git a/apps/swp2clk/boot.js b/apps/swp2clk/boot.js index 54486742a..3119ce06b 100644 --- a/apps/swp2clk/boot.js +++ b/apps/swp2clk/boot.js @@ -1,3 +1,20 @@ +/** + * How does this work? + * + * Every *boot.js file is executed everytime any app is loaded, including this one. + * We just need to figure out which app is currently loaded, in case we are in the white list / black list mode, + * to figure out if the swipe handler should be attached or not. + * It does not seem to be the case that this can be done easily, but we can work around it. + * It seems that every app is loaded via the global "load" function, which takes a fileName as it's first parameter to load any app + * or the default clock when the fileName is undefined. + * To be able to use this for us, we wrap the global "load" function, and determine before loading the next app, + * whether the swipe handler should be added or not, since we now know which app will be loaded. + * Note: We cannot add the swipe handler inside the wrapped "load" function, because once the "load" function is complete + * everything is cleaned up. That's why we merely save a flag, whether the swipe handler should be attached or not, + * which is evaluated once this file is executed again, which will be right after the load function completes + * (since every *boot.js file is executed everytime any app is loaded). + */ + (function () { var DEBUG = true; var FILE = "swp2clk.data.json";