dtlaunch: postpone load icons not initially needed

Draw the first screen, then load in the rest of the icons from storage.
pull/3629/head
thyttan 2024-10-29 16:45:26 +01:00
parent 8acffd521d
commit 257d88dc2e
3 changed files with 11 additions and 5 deletions

View File

@ -30,3 +30,4 @@ when moving pages. Add caching for faster startups.
0.23: Bangle 1: Fix issue with missing icons, added touch screen interactions
0.24: Add buzz-on-interaction setting
0.25: Minor code improvements
0.26: Bangle 2: Postpone loading icons that are not needed initially.

View File

@ -33,10 +33,10 @@
s.writeJSON("launch.cache.json", launchCache);
}
let apps = launchCache.apps;
apps.forEach(app=>{
if (app.icon)
app.icon = s.read(app.icon); // should just be a link to a memory area
});
for (let i = 0; i < 4; i++) { // Initially only load icons for the current page.
if (apps[i].icon)
apps[i].icon = s.read(apps[i].icon); // should just be a link to a memory area
}
let Napps = apps.length;
let Npages = Math.ceil(Napps/4);
@ -101,6 +101,11 @@
Bangle.loadWidgets();
drawPage(0);
for (let i = 4; i < apps.length; i++) { // Load the rest of the app icons that were not initially.
if (apps[i].icon)
apps[i].icon = s.read(apps[i].icon); // should just be a link to a memory area
}
let swipeListenerDt = function(dirLeftRight, dirUpDown){
updateTimeoutToClock();
selected = -1;

View File

@ -1,7 +1,7 @@
{
"id": "dtlaunch",
"name": "Desktop Launcher",
"version": "0.25",
"version": "0.26",
"description": "Desktop style App Launcher with six (four for Bangle 2) apps per page - fast access if you have lots of apps installed.",
"screenshots": [{"url":"shot1.png"},{"url":"shot2.png"},{"url":"shot3.png"}],
"icon": "icon.png",