launcher 0.23: Draw a placeholder screen right at the start to speed up apparent boot time
parent
73f376e5e3
commit
62a4d8f5d4
|
|
@ -21,4 +21,5 @@
|
||||||
0.19: Fix regression after back button added (returnToClock was called twice!)
|
0.19: Fix regression after back button added (returnToClock was called twice!)
|
||||||
0.20: Use Bangle.showClock for changing to clock
|
0.20: Use Bangle.showClock for changing to clock
|
||||||
0.21: Make the "App source not found" warning less buggy
|
0.21: Make the "App source not found" warning less buggy
|
||||||
0.22: Add less padding between launcher items, use new font if available in 2v26+
|
0.22: Add less padding between launcher items, use new font if available in 2v26+
|
||||||
|
0.23: Draw a placeholder screen right at the start to speed up apparent boot time
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
{ // must be inside our own scope here so that when we are unloaded everything disappears
|
{ // must be inside our own scope here so that when we are unloaded everything disappears
|
||||||
let s = require("Storage");
|
let s = require("Storage");
|
||||||
// handle customised launcher
|
// handle customised launcher
|
||||||
let scaleval = 1;
|
let scaleval = 1, vectorval = 20, fonts = g.getFonts();
|
||||||
let vectorval = 20;
|
let font = fonts.includes("12x20") ? "12x20" : "6x8:2";
|
||||||
let font = g.getFonts().includes("12x20") ? "12x20" : "6x8:2";
|
if (fonts.includes("22")) font="22"; // 2v26+
|
||||||
if (g.getFonts().includes("22")) font="22"; // 2v26+
|
|
||||||
let settings = Object.assign({
|
let settings = Object.assign({
|
||||||
showClocks: true,
|
showClocks: true,
|
||||||
fullscreen: false
|
fullscreen: false
|
||||||
|
|
@ -20,6 +19,19 @@
|
||||||
scaleval = (font.split("x")[1])/20;
|
scaleval = (font.split("x")[1])/20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let height = 50*scaleval;
|
||||||
|
|
||||||
|
// Now apps list is loaded - render
|
||||||
|
if (!settings.fullscreen)
|
||||||
|
Bangle.loadWidgets();
|
||||||
|
let R = Bangle.appRect;
|
||||||
|
g.reset().clearRect(R).setColor("#888");
|
||||||
|
for (var y=R.y;y<R.y2;y+=height) {
|
||||||
|
g.drawRect(5*scaleval,y+5*scaleval,49*scaleval,y+49*scaleval) // image
|
||||||
|
.drawRect(54*scaleval,y+20*scaleval,R.y2-16,y+34*scaleval); // text
|
||||||
|
}
|
||||||
|
g.flip();
|
||||||
|
|
||||||
// cache app list so launcher loads more quickly
|
// cache app list so launcher loads more quickly
|
||||||
let launchCache = s.readJSON("launch.cache.json", true)||{};
|
let launchCache = s.readJSON("launch.cache.json", true)||{};
|
||||||
let launchHash = require("Storage").hash(/\.info/);
|
let launchHash = require("Storage").hash(/\.info/);
|
||||||
|
|
@ -39,13 +51,11 @@
|
||||||
s.writeJSON("launch.cache.json", launchCache);
|
s.writeJSON("launch.cache.json", launchCache);
|
||||||
}
|
}
|
||||||
let apps = launchCache.apps;
|
let apps = launchCache.apps;
|
||||||
// Now apps list is loaded - render
|
|
||||||
if (!settings.fullscreen)
|
|
||||||
Bangle.loadWidgets();
|
|
||||||
|
|
||||||
const drawMenu = () => {
|
const drawMenu = () => {
|
||||||
E.showScroller({
|
E.showScroller({
|
||||||
h : 50*scaleval, c : apps.length,
|
h : height, c : apps.length,
|
||||||
draw : (i, r) => {
|
draw : (i, r) => {
|
||||||
var app = apps[i];
|
var app = apps[i];
|
||||||
if (!app) return;
|
if (!app) return;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "launch",
|
"id": "launch",
|
||||||
"name": "Launcher",
|
"name": "Launcher",
|
||||||
"shortName": "Launcher",
|
"shortName": "Launcher",
|
||||||
"version": "0.22",
|
"version": "0.23",
|
||||||
"description": "This is needed to display a menu allowing you to choose your own applications. You can replace this with a customised launcher.",
|
"description": "This is needed to display a menu allowing you to choose your own applications. You can replace this with a customised launcher.",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue