Andee lives on your phone or Mac and uses any app like you do—no integrations, no root, any model; memory and passwords never leave your device | Andee 住进你的手机或 Mac,像你一样操作任何 App——无需集成、无需 Root、支持任意模型,记忆和密码绝不离开设备。
fix(ui): lighten the fullscreen card's backdrop scrim
booboosui27c945f46e60
diff --git a/CLAUDE.md b/CLAUDE.mdindex 5231d64..4f25b82 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -377,7 +377,7 @@ Nothing here animates for decoration — each one answers a question the user woFour things about that spread are not cosmetic:-- **The fullscreen card brings its own background (`ui/Backdrop.kt`).** Frost was the right answer for a modal over a document and the wrong one for this card: it is fullscreen, it stays up for minutes, and what came through it was the user's home screen — icons and all, dissolved behind the text. So the card now covers the window with one fixed image, blurred by us and darkened by a scrim. Three consequences: the compositor blur is *dropped* while it is up (nothing left behind to defrost — a full screen of GPU defocus nobody can see, and it makes the card look the same on the many devices where `isCrossWindowBlurEnabled` is false); the blur is a three-pass box blur on a 512-px-wide copy, not `RenderEffect` (see below) and not a downscale-upscale, which smears rather than frosts; and the scrim is *derived* from the image — `1 − 0.13 / meanLuma`, clamped to 55–85% black — so 0.13 is the composite the card already had, and swapping `res/drawable-nodpi/backdrop.jpg` needs no new constants. Decode and blur run on a worker at build time, and the window is built folded, so it never touches the main thread.+- **The fullscreen card brings its own background (`ui/Backdrop.kt`).** Frost was the right answer for a modal over a document and the wrong one for this card: it is fullscreen, it stays up for minutes, and what came through it was the user's home screen — icons and all, dissolved behind the text. So the card now covers the window with one fixed image, blurred by us and darkened by a scrim. Three consequences: the compositor blur is *dropped* while it is up (nothing left behind to defrost — a full screen of GPU defocus nobody can see, and it makes the card look the same on the many devices where `isCrossWindowBlurEnabled` is false); the blur is a three-pass box blur on a 512-px-wide copy, not `RenderEffect` (see below) and not a downscale-upscale, which smears rather than frosts; and the scrim is *derived* from the image — `1 − 0.22 / meanLuma`, clamped to 38–75% black — it started at 0.13 (the composite the frosted card already had) and was raised after 0.13 read as a black wall on a card that stays up for minutes; swapping `res/drawable-nodpi/backdrop.jpg` needs no new constants. Decode and blur run on a worker at build time, and the window is built folded, so it never touches the main thread.- The scrim goes on the **image's foreground**, not the root's background. They look interchangeable and are not: the image is a child of the root, so a root background is behind the very thing it is meant to darken. The first version did that and shipped a card at raw photo brightness — measured on the tablet at mean luma 0.40 against a design of 0.13.- **The self-check page reuses that same image and that same `scrim()`**, via the same `ready()` / `warm()` handshake. It is a second surface in the same product, so "a lookalike dark background" was the one option not on the table — two surfaces that nearly match read as a rendering bug, where two that deliberately differ read as two things. `stage` also makes this cheap: the backdrop is added once and never rebuilt, so changing language swaps the content above it rather than re-decoding a bitmap.- **The fullscreen card frosts, the corner ball must not, and `applyWindow()` owns the switch.** It is one window in two shapes, so `Glass.frost` has a four-argument overload that can take the flag back off — applied with `updateViewLayout` after the fact, which does work, unlike `backgroundBlurRadius`. A 168 dp blurred square following the ball around is a smudge, so it is dropped when folded. It is *also* dropped whenever `setVisibleForCapture(false)` is in force: the window is at alpha 0 there, but the compositor would still defocus what is behind it, and what is behind it is exactly the screenshot the brain is about to read. `blankedForCapture`'s existing 80 ms settle covers the params change.diff --git a/app/src/main/java/net/kuafuai/andee/ui/Backdrop.kt b/app/src/main/java/net/kuafuai/andee/ui/Backdrop.ktindex bc3d45c..eb49828 100644--- a/app/src/main/java/net/kuafuai/andee/ui/Backdrop.kt+++ b/app/src/main/java/net/kuafuai/andee/ui/Backdrop.kt@@ -85,14 +85,13 @@ object Backdrop {/*** What the backdrop's mean luminance should end up at, once the scrim is on.*- * 0.13 is not a taste-free number: it is what the card already composites to- * today, on average — `CARD_FROSTED` is 60% black over a blurred desktop,- * and a desktop averages 0.25–0.4. So this keeps every contrast decision- * made above it valid (the `LABEL`/`SECONDARY` text, the `PANEL` and `WELL`- * films, the `#2BFFFFFF` hairline) while changing *what* those decisions are- * sitting on.+ * Started at 0.13 — what `CARD_FROSTED` (60% black over a blurred desktop)+ * composites to on average — and was raised to 0.22 after use: on a card+ * that stays up for minutes, 0.13 read as a black wall with a photo buried+ * in it. 0.22 is about the ceiling: past it the pale ball and the+ * `SECONDARY` text start to lose contrast against the image.*/- private const val TARGET_LUMA = 0.13f+ private const val TARGET_LUMA = 0.22f/*** Bounds on the derived scrim, so a very dark or very bright photo cannot@@ -100,8 +99,8 @@ object Backdrop {* keeps text legible over a near-black image; the ceiling keeps the image* from disappearing under a near-white one.*/- private const val SCRIM_MIN = 0.55f- private const val SCRIM_MAX = 0.85f+ private const val SCRIM_MIN = 0.38f+ private const val SCRIM_MAX = 0.75fprivate val ui = Handler(Looper.getMainLooper())private val worker = Executors.newSingleThreadExecutor { r ->