Add an Android home-screen launcher built with ultra
examples/launcher is the home screen as an ultra app: clock, app search (Enter opens the first match), icon grid and a pinned dock kept in localStorage. android/ is a dependency-free Java shell that serves it to a transparent WebView over the wallpaper, answers apps.json and icon PNGs from LauncherApps, and bridges launch/app info/settings/wallpaper. CI builds the APK and publishes it as the launcher-latest release. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019EEjkJVV72Lu8ndDVWg5BT
This commit is contained in:
1 parent
7c6a68b26e
commit
9443761b4a
24 files changed
+2068
No files matched your search
@@ -178,5 +178,32 @@ const BASE = process.env.BASE || "http://localhost:8000";
|
||||
assert.ok(await p.$(".page.dark"));
|
||||
console.log("ui ok");
|
||||
|
||||
// launcher: the Android home screen, against the demo apps.json
|
||||
await p.goto(BASE + "/examples/launcher/");
|
||||
await p.evaluate(() => localStorage.clear());
|
||||
await p.reload();
|
||||
await p.waitForSelector(".tile");
|
||||
const names = () => p.$$eval(".tile .name", (ns) => ns.map((n) => n.textContent));
|
||||
assert.equal((await names()).length, 16);
|
||||
assert.match(await p.textContent(".clock .time"), /^\d{1,2}:\d\d$/);
|
||||
await p.fill(".search input", "ca"); await tick();
|
||||
assert.deepEqual(await names(), ["Calculator", "Calendar", "Camera"]);
|
||||
await p.press(".search input", "Enter"); await tick();
|
||||
assert.equal(await p.textContent("#toast"), "Open com.example.calculator/.MainActivity");
|
||||
assert.equal(await p.inputValue(".search input"), "", "launching clears the search");
|
||||
await p.click("text=Edit dock"); await tick();
|
||||
await p.click(".tile:nth-child(4)", { force: true }); await p.click(".tile:nth-child(8)", { force: true }); await tick();
|
||||
assert.equal(await p.$$eval(".tile.pinned", (ts) => ts.length), 2);
|
||||
await p.click("text=Done"); await tick();
|
||||
await p.reload(); await p.waitForSelector(".dock-app");
|
||||
assert.deepEqual(await p.$$eval(".dock-app", (ds) => ds.map((d) => d.getAttribute("aria-label"))), ["Chrome", "Gmail"]);
|
||||
await p.click(".dock-app:first-child"); await tick();
|
||||
assert.equal(await p.textContent("#toast"), "Open com.example.chrome/.MainActivity");
|
||||
await p.fill(".search input", "zzz"); await tick();
|
||||
assert.equal(await p.textContent(".empty"), "No apps match.");
|
||||
await p.evaluate(() => window.ultraHome.back()); await tick();
|
||||
assert.equal((await names()).length, 16, "back clears the search");
|
||||
console.log("launcher ok");
|
||||
|
||||
await b.close();
|
||||
})().catch((e) => { console.error(e); process.exit(1); });
|
||||
Reference in new issue
Block a user