Android: design review fixes, icon, signed releases, the site's Android downloads
- The design review (docs/design/android-ui.md §17): the move buttons in the bottom bar (snackbars above them), ripple on press, larger ◀ ▶, coordinates over the pieces, readable NAG colors in the light theme, 16 dp edges, the ⋮ menu (game details, copy PGN/FEN, share), "Deeper" next to ▾, TalkBack states, no "*" for unfinished games, "Found N of M", texts. - The penguin as the adaptive icon and on the splash screen; dark window. - Release builds: R8, signing from the environment, androidApp/scripts/release.sh (two APKs, apksigner and 16 KB alignment checks); the release workflow builds them from the repository secrets. - Website: the Android tab with both APKs, "Download for Android" on phones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
68fcabd691
commit
de5ca02a82
54 changed files with 700 additions and 401 deletions
|
|
@ -13,7 +13,8 @@
|
|||
var ua = navigator.userAgent || "";
|
||||
var platform = (navigator.userAgentData && navigator.userAgentData.platform) || navigator.platform || "";
|
||||
var touchMac = /Mac/.test(platform) && navigator.maxTouchPoints > 1;
|
||||
if (/iPhone|iPod|iPad|Android/i.test(ua) || touchMac) return { os: "mobile" };
|
||||
if (/Android/i.test(ua)) return { os: "android", slug: "android" };
|
||||
if (/iPhone|iPod|iPad/i.test(ua) || touchMac) return { os: "mobile" };
|
||||
if (/CrOS/.test(ua)) return { os: "linux", slug: "deb", chromeos: true };
|
||||
if (/Win/.test(platform) || /Windows/.test(ua)) return { os: "windows", slug: "windows" };
|
||||
if (/Mac/.test(platform) || /Macintosh/.test(ua)) return { os: "macos", slug: "macos" };
|
||||
|
|
@ -25,7 +26,7 @@
|
|||
return { os: "unknown" };
|
||||
}
|
||||
var sys = detect();
|
||||
var FORMAT = { windows: ".zip", deb: ".deb", rpm: ".rpm", appimage: "AppImage" };
|
||||
var FORMAT = { windows: ".zip", deb: ".deb", rpm: ".rpm", appimage: "AppImage", android: "APK" };
|
||||
|
||||
function intelMac() {
|
||||
try {
|
||||
|
|
@ -60,11 +61,12 @@
|
|||
var asset = CP.assets[sys.slug];
|
||||
btn.href = "/download/" + sys.slug;
|
||||
btn.dataset.platform = sys.slug;
|
||||
l1.textContent = t(sys.os === "windows" ? "btn_windows" : sys.os === "macos" ? "btn_macos" : "btn_linux");
|
||||
l1.textContent = t({ windows: "btn_windows", macos: "btn_macos", android: "btn_android" }[sys.os] || "btn_linux");
|
||||
var parts = [CP.version ? t("btn_version").replace("{version}", CP.version) : t("btn_latest")];
|
||||
if (asset) parts.push(asset.size);
|
||||
parts.push(sys.os === "macos" ? t("apple_silicon") : FORMAT[sys.slug]);
|
||||
if (sys.chromeos) parts.push(t("chromeos"));
|
||||
if (sys.os === "android") parts.push(t("and_full_title"));
|
||||
l2.textContent = parts.join(" · ");
|
||||
if (sys.os === "macos") {
|
||||
var note = $("hero-note");
|
||||
|
|
@ -73,6 +75,12 @@
|
|||
else note.textContent = t("mac_requires");
|
||||
$("hero-mac").hidden = false;
|
||||
}
|
||||
if (sys.os === "android") {
|
||||
var req = $("hero-note");
|
||||
req.hidden = false;
|
||||
req.textContent = t("and_requires");
|
||||
$("hero-android").hidden = false;
|
||||
}
|
||||
if (sys.os === "linux") {
|
||||
$("hero-links").hidden = true;
|
||||
var formats = $("hero-formats");
|
||||
|
|
@ -121,6 +129,7 @@
|
|||
again.appendChild(a1); again.appendChild(document.createTextNode(" · ")); again.appendChild(a2);
|
||||
panel.appendChild(again);
|
||||
if (platform === "windows") panel.appendChild(el("p", null, t("next_windows")));
|
||||
else if (platform === "android" || platform === "android-noengine") panel.appendChild(el("p", null, t("next_android")));
|
||||
else if (platform === "macos") {
|
||||
// Gatekeeper warns about every app not signed by Apple: say so before it happens.
|
||||
panel.appendChild(el("h4", null, t("next_macos_title")));
|
||||
|
|
@ -199,7 +208,7 @@
|
|||
select(tabs[(j + tabs.length) % tabs.length], true);
|
||||
});
|
||||
});
|
||||
var mine = { windows: "tab-windows", macos: "tab-macos", linux: "tab-linux" }[sys.os];
|
||||
var mine = { windows: "tab-windows", macos: "tab-macos", linux: "tab-linux", android: "tab-android" }[sys.os];
|
||||
if (mine) {
|
||||
$(mine).querySelector("small").hidden = false;
|
||||
select($(mine));
|
||||
|
|
@ -218,7 +227,7 @@
|
|||
var id = location.hash.slice(1);
|
||||
if (!id || /^screenshot-/.test(id)) return;
|
||||
if (id.indexOf("download-") === 0) {
|
||||
var panelId = id.replace(/^(download-(windows|macos|linux)).*/, "$1");
|
||||
var panelId = id.replace(/^(download-(windows|macos|linux|android)).*/, "$1");
|
||||
var tab = tabs.filter(function (x) { return x.getAttribute("aria-controls") === panelId; })[0];
|
||||
if (tab) select(tab);
|
||||
var target = $(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue