mirror of https://github.com/espruino/BangleApps
iconlaunch - Use objects instead of arrays
parent
7e0dbbf6f0
commit
a9fff20477
|
@ -45,18 +45,20 @@
|
||||||
const iconYoffset = Math.floor(whitespace/4)-1;
|
const iconYoffset = Math.floor(whitespace/4)-1;
|
||||||
const itemSize = iconSize + whitespace;
|
const itemSize = iconSize + whitespace;
|
||||||
|
|
||||||
launchCache.items = [];
|
let t = Date.now();
|
||||||
|
launchCache.items = {};
|
||||||
for (let c of launchCache.apps){
|
for (let c of launchCache.apps){
|
||||||
let i = Math.floor(count/appsN);
|
let i = Math.floor(count/appsN);
|
||||||
if (!launchCache.items[i])
|
if (!launchCache.items[i])
|
||||||
launchCache.items.push([]);
|
launchCache.items[i] = {};
|
||||||
launchCache.items[Math.floor(count/appsN)].push(c);
|
launchCache.items[i].push(count%3);
|
||||||
if (c.icon)
|
if (c.icon)
|
||||||
c.icondata = s.read(c.icon);
|
c.icondata = s.read(c.icon);
|
||||||
else
|
else
|
||||||
c.icondata = ICON_MISSING;
|
c.icondata = ICON_MISSING;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
let drawItem = function(itemI, r) {
|
let drawItem = function(itemI, r) {
|
||||||
let x = 0;
|
let x = 0;
|
||||||
let apps = launchCache.items[itemI];
|
let apps = launchCache.items[itemI];
|
||||||
|
|
Loading…
Reference in New Issue