feat: add app for navigate between clock and launcher with Swipe action

pull/858/head
Victor Serain 2021-10-22 16:56:20 +02:00
parent e1c070ccfb
commit 1624bb5435
4 changed files with 31 additions and 0 deletions

View File

@ -4101,5 +4101,18 @@
{"name":"gpstouch.app.js","url":"gpstouch.app.js"},
{"name":"gpstouch.img","url":"gpstouch.icon.js","evaluate":true}
]
},
{
"id": "swiperclocklaunch",
"name": "Swiper Clock Launch",
"version": "0.01",
"description": "Navigate between clock and launcher with Swipe action",
"icon": "swiperclocklaunch.png",
"type": "boot",
"tags": "system",
"supports": ["BANGLEJS", "BANGLEJS2"],
"storage": [
{"name":"swiperclocklaunch.boot.js","url":"boot.js"}
]
}
]

View File

@ -0,0 +1 @@
0.01: New App!

View File

@ -0,0 +1,17 @@
// clock -> launcher
(function() {
var sui = Bangle.setUI;
Bangle.setUI = function(mode, cb) {
sui(mode,cb);
if (!mode.startsWith("clock")) return;
Bangle.swipeHandler = dir => { if (dir<0) Bangle.showLauncher(); };
Bangle.on("swipe", Bangle.swipeHandler);
};
})();
// launcher -> clock
setTimeout(function() {
if (global.__FILE__ && __FILE__.endsWith(".app.js") && (require("Storage").readJSON(__FILE__.slice(0,-6)+"info",1)||{}).type=="launch") {
Bangle.swipeHandler = dir => { if (dir>0) load(); };
Bangle.on("swipe", Bangle.swipeHandler);
}
}, 10);

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 B