launcher: hoist Animatable out of test composition
- Commit
40b87f706457510bb7923fab8d2c89cc9a3e26e3- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-08 06:08 UTC (28 days ago)
- Parents
703b4f0
What: in LauncherHomePopupsTest.show(), construct the Animatable(1f) passed
as popup before rule.setContent instead of inline in the composition.
Why: :launcher:lintDev failed on RememberInComposition — calling a
@RememberInComposition-annotated declaration (Animatable constructor) inside
composition without using remember.
Root cause: same as the identical games-wordmaker failure fixed earlier in
this drive — the inline Animatable(1f) runs on every recomposition, resetting
animation state each time. In this static-render test nothing animates, so it
only tripped the lint gate.
Rejected alternatives: wrapping in remember { } inside setContent (keeps
construction in composition); lint suppression (hides a real recomposition
hazard).
User-visible effect: none; test-only change.
Verification: :launcher:lint green, :launcher:testDevUnitTest 312/0/0.Diff
launcher/src/test/java/com/vayunmathur/launcher/ui/LauncherHomePopupsTest.kt
diff --git a/launcher/src/test/java/com/vayunmathur/launcher/ui/LauncherHomePopupsTest.kt b/launcher/src/test/java/com/vayunmathur/launcher/ui/LauncherHomePopupsTest.ktindex d72c427954..be988414f5 100644--- a/launcher/src/test/java/com/vayunmathur/launcher/ui/LauncherHomePopupsTest.kt+++ b/launcher/src/test/java/com/vayunmathur/launcher/ui/LauncherHomePopupsTest.kt@@ -45,6 +45,7 @@ class LauncherHomePopupsTest { optionsAnchor: Rect? = null, widgetPickerOpen: Boolean = false, ) {+ val popup = Animatable(1f) rule.setContent { CompositionLocalProvider(LocalLauncherDrag provides LauncherDragController()) { HomePopups(@@ -56,7 +57,7 @@ class LauncherHomePopupsTest { canUninstall = true, ), itemMenuActions = ItemMenuActions.Noop,- popup = Animatable(1f),+ popup = popup, onClosePopup = {}, optionsAnchor = optionsAnchor, onPickWallpaper = {},