Qt: show home icons at once on start, and keep them when other apps change

Home app tiles waited for the full app list (every app listed and labelled
over JNI, slow on a phone) before they showed, while widgets showed at once.
The last app list is now kept and the home starts from it; nothing on home
is hidden until the fresh list has loaded. A package change used to reload
every icon on screen; now only that package's icons are drawn again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiQsCq11CwCPnKPp9D
This commit is contained in:
Claude committed 2026-11-03 01:20:22 +00:00
1 parent 2028bf7a29
commit 8abe104dda
7 files changed
+69 -32

No files matched your search

@@ -90,11 +90,11 @@ public class HomeActivity extends QtActivity {
private final int[] layerAt = new int[2];
private final LauncherApps.Callback packages = new LauncherApps.Callback() {
@Override public void onPackageRemoved(String pkg, UserHandle u) { appsChanged(); }
@Override public void onPackageAdded(String pkg, UserHandle u) { appsChanged(); }
@Override public void onPackageChanged(String pkg, UserHandle u) { appsChanged(); }
@Override public void onPackagesAvailable(String[] pkgs, UserHandle u, boolean replacing) { appsChanged(); }
@Override public void onPackagesUnavailable(String[] pkgs, UserHandle u, boolean replacing) { appsChanged(); }
@Override public void onPackageRemoved(String pkg, UserHandle u) { appsChanged(pkg); }
@Override public void onPackageAdded(String pkg, UserHandle u) { appsChanged(pkg); }
@Override public void onPackageChanged(String pkg, UserHandle u) { appsChanged(pkg); }
@Override public void onPackagesAvailable(String[] pkgs, UserHandle u, boolean replacing) { appsChanged(String.join(",", pkgs)); }
@Override public void onPackagesUnavailable(String[] pkgs, UserHandle u, boolean replacing) { appsChanged(String.join(",", pkgs)); }
};
@Override
@@ -252,8 +252,9 @@ public class HomeActivity extends QtActivity {
if (qtReady) Native.backPressed();
}
private void appsChanged() {
if (qtReady) Native.appsChanged();
/** packages: the ones that changed, comma-separated, so only their icons are redrawn. */
private void appsChanged(String packages) {
if (qtReady) Native.appsChanged(packages == null ? "" : packages);
}
// ------------------------------------------------------------ called from Qt
@@ -8,7 +8,7 @@ package dev.ultra.launcher;
final class Native {
private Native() {}
static native void appsChanged();
static native void appsChanged(String packages); // comma-separated
static native void homePressed();
static native void backPressed();
static native void insets(int top, int bottom);