1
0
Fork 0

Merge pull request #2271 from thyttan/iconlaunch

[Icon launcher] Use Bangle.load and Bangle.showClock
master
Gordon Williams 2022-11-15 10:34:11 +00:00 committed by GitHub
commit 9827415380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 28 deletions

View File

@ -14,3 +14,4 @@
added timeOut to return to the clock added timeOut to return to the clock
0.11: Cleanup timeout when changing to clock 0.11: Cleanup timeout when changing to clock
Reset timeout on swipe and drag Reset timeout on swipe and drag
0.12: Use Bangle.load and Bangle.showClock

View File

@ -94,7 +94,7 @@
const appId = id * appsN + iconN; const appId = id * appsN + iconN;
if( settings.direct && launchCache.apps[appId]) if( settings.direct && launchCache.apps[appId])
{ {
load(launchCache.apps[appId].src); Bangle.load(launchCache.apps[appId].src);
return; return;
} }
if (appId == selectedItem && launchCache.apps[appId]) { if (appId == selectedItem && launchCache.apps[appId]) {
@ -102,7 +102,7 @@
if (!app.src || s.read(app.src) === undefined) { if (!app.src || s.read(app.src) === undefined) {
E.showMessage( /*LANG*/ "App Source\nNot found"); E.showMessage( /*LANG*/ "App Source\nNot found");
} else { } else {
load(app.src); Bangle.load(app.src);
} }
} }
selectedItem = appId; selectedItem = appId;
@ -186,30 +186,13 @@
let i = YtoIdx(e.y); let i = YtoIdx(e.y);
selectItem(i, e); selectItem(i, e);
}, },
swipe: (h,_) => { if(settings.swipeExit && h==1) { returnToClock(); } }, swipe: (h,_) => { if(settings.swipeExit && h==1) { Bangle.showClock(); } },
btn: _=> { if (settings.oneClickExit) Bangle.showClock(); },
remove: function() {
if (timeout) clearTimeout(timeout);
}
}; };
const returnToClock = function() {
Bangle.setUI();
delete launchCache;
delete launchHash;
delete drawItemAuto;
delete drawText;
delete selectItem;
delete onDrag;
delete drawItems;
delete drawItem;
delete returnToClock;
delete idxToY;
delete YtoIdx;
delete settings;
if (timeout) clearTimeout(timeout);
setTimeout(eval, 0, s.read(".bootcde"));
};
if (settings.oneClickExit) mode.btn = returnToClock;
let timeout; let timeout;
const updateTimeout = function(){ const updateTimeout = function(){
if (settings.timeOut!="Off"){ if (settings.timeOut!="Off"){
@ -217,7 +200,7 @@
if (timeout) clearTimeout(timeout); if (timeout) clearTimeout(timeout);
timeout = setTimeout(returnToClock,time*1000); timeout = setTimeout(returnToClock,time*1000);
} }
} };
updateTimeout(); updateTimeout();

View File

@ -2,7 +2,7 @@
"id": "iconlaunch", "id": "iconlaunch",
"name": "Icon Launcher", "name": "Icon Launcher",
"shortName" : "Icon launcher", "shortName" : "Icon launcher",
"version": "0.11", "version": "0.12",
"icon": "app.png", "icon": "app.png",
"description": "A launcher inspired by smartphones, with an icon-only scrollable menu.", "description": "A launcher inspired by smartphones, with an icon-only scrollable menu.",
"tags": "tool,system,launcher", "tags": "tool,system,launcher",