Skip to content

Commit

Permalink
Merge pull request espruino#3629 from thyttan/dtlaunch
Browse files Browse the repository at this point in the history
dtlaunch: postpone load icons not initially needed
  • Loading branch information
bobrippling authored Oct 29, 2024
2 parents 9805bb1 + 257d88d commit 93de0b5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/dtlaunch/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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.
13 changes: 9 additions & 4 deletions apps/dtlaunch/app-b2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/dtlaunch/metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 93de0b5

Please sign in to comment.