Skip to content

Commit 62a4d8f

Browse files
committed
launcher 0.23: Draw a placeholder screen right at the start to speed up apparent boot time
1 parent 73f376e commit 62a4d8f

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

apps/launch/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121
0.19: Fix regression after back button added (returnToClock was called twice!)
2222
0.20: Use Bangle.showClock for changing to clock
2323
0.21: Make the "App source not found" warning less buggy
24-
0.22: Add less padding between launcher items, use new font if available in 2v26+
24+
0.22: Add less padding between launcher items, use new font if available in 2v26+
25+
0.23: Draw a placeholder screen right at the start to speed up apparent boot time

apps/launch/app.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{ // must be inside our own scope here so that when we are unloaded everything disappears
22
let s = require("Storage");
33
// handle customised launcher
4-
let scaleval = 1;
5-
let vectorval = 20;
6-
let font = g.getFonts().includes("12x20") ? "12x20" : "6x8:2";
7-
if (g.getFonts().includes("22")) font="22"; // 2v26+
4+
let scaleval = 1, vectorval = 20, fonts = g.getFonts();
5+
let font = fonts.includes("12x20") ? "12x20" : "6x8:2";
6+
if (fonts.includes("22")) font="22"; // 2v26+
87
let settings = Object.assign({
98
showClocks: true,
109
fullscreen: false
@@ -20,6 +19,19 @@
2019
scaleval = (font.split("x")[1])/20;
2120
}
2221
}
22+
let height = 50*scaleval;
23+
24+
// Now apps list is loaded - render
25+
if (!settings.fullscreen)
26+
Bangle.loadWidgets();
27+
let R = Bangle.appRect;
28+
g.reset().clearRect(R).setColor("#888");
29+
for (var y=R.y;y<R.y2;y+=height) {
30+
g.drawRect(5*scaleval,y+5*scaleval,49*scaleval,y+49*scaleval) // image
31+
.drawRect(54*scaleval,y+20*scaleval,R.y2-16,y+34*scaleval); // text
32+
}
33+
g.flip();
34+
2335
// cache app list so launcher loads more quickly
2436
let launchCache = s.readJSON("launch.cache.json", true)||{};
2537
let launchHash = require("Storage").hash(/\.info/);
@@ -39,13 +51,11 @@
3951
s.writeJSON("launch.cache.json", launchCache);
4052
}
4153
let apps = launchCache.apps;
42-
// Now apps list is loaded - render
43-
if (!settings.fullscreen)
44-
Bangle.loadWidgets();
54+
4555

4656
const drawMenu = () => {
4757
E.showScroller({
48-
h : 50*scaleval, c : apps.length,
58+
h : height, c : apps.length,
4959
draw : (i, r) => {
5060
var app = apps[i];
5161
if (!app) return;

apps/launch/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "launch",
33
"name": "Launcher",
44
"shortName": "Launcher",
5-
"version": "0.22",
5+
"version": "0.23",
66
"description": "This is needed to display a menu allowing you to choose your own applications. You can replace this with a customised launcher.",
77
"readme": "README.md",
88
"icon": "app.png",

0 commit comments

Comments
 (0)