1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-11 16:22:09 -04:00

launcher v2: performance optimizations

- Use ListView in all tab
- use filesystem cache to speed up first launch
- apply highlights to visible models
This commit is contained in:
bbedward
2026-02-10 14:56:29 -05:00
parent 46a2f6f0d8
commit 5342647bfb
10 changed files with 460 additions and 332 deletions

View File

@@ -220,6 +220,7 @@ function groupBySection(scoredItems, sectionOrder, sortAlphabetically, maxPerSec
function flattenSections(sections) {
var flat = []
var bounds = {}
for (var i = 0; i < sections.length; i++) {
var section = sections[i]
@@ -231,7 +232,8 @@ function flattenSections(sections) {
sectionIndex: i
})
section.flatStartIndex = flat.length
var itemStart = flat.length
section.flatStartIndex = itemStart
if (!section.collapsed) {
for (var j = 0; j < section.items.length; j++) {
@@ -244,7 +246,18 @@ function flattenSections(sections) {
})
}
}
var itemEnd = flat.length - 1
var itemCount = flat.length - itemStart
if (itemCount > 0) {
bounds[section.id] = {
start: itemStart,
end: itemEnd,
count: itemCount
}
}
}
flat._sectionBounds = bounds
return flat
}