AppIconCache

Icon loading for the drawer's A–Z rail in icon-preview mode (#4). Foyer is text-first — icons exist nowhere else in the app. warmAll pre-loads every installed app's icon in the background as soon as the drawer opens (icon-preview mode only), so peek returns instantly once the finger actually touches the rail; icon is the suspend fallback for anything not yet warmed. Profile-aware via LauncherApps.

Functions

Link copied to clipboard
suspend fun icon(context: Context, app: AppEntry): ImageBitmap?
Link copied to clipboard
fun invalidate(packageName: String)

Drops every cached icon for packageName (all activities, all profiles) so the next peek/icon call re-fetches it. Without this, an app update that changes its icon would show the stale one for the rest of the process's life — warmAll and icon() both skip anything already present via LinkedHashMap.containsKey, and the cache is now large enough (MAX = 800) that natural LRU eviction rarely reaches it. Call this from LauncherApps.Callback.onPackageChanged/onPackageRemoved.

Link copied to clipboard

Synchronous, no coroutine hop — null only if not yet warmed/fetched.

Link copied to clipboard
suspend fun warmAll(context: Context, apps: List<AppEntry>)

Loads every app not already cached, one background dispatch for the whole batch.