One card, four announcements — merging is the fix
A composite component produces one semantics node per child by default, so a card becomes four swipes. mergeDescendants, clearAndSetSemantics and invisibleToUser control the shape of the tree.
We use Google Analytics to see which pages help people. No ads, no profiles. Privacy Policy
129 posts
A composite component produces one semantics node per child by default, so a card becomes four swipes. mergeDescendants, clearAndSetSemantics and invisibleToUser control the shape of the tree.
Every Compose UI produces a semantics tree alongside the layout tree. It's what screen readers read, what tests query, and what autofill inspects — so getting it right serves three audiences at once.
Compose tests idle-wait by default, which makes animated UI either flaky or untested. Disabling autoAdvance gives you frame-level control, turning 'wait and hope' into deterministic assertions at chosen moments.
Shared element transitions match two composables by key and animate between their bounds. Understanding that neither element travels — a third overlay draws the motion — explains the scope requirements and the common failures.
An element removed by an if is gone immediately, so an exit animation has nothing to animate. AnimatedVisibility keeps it composed until the exit finishes — and AnimatedContent does the same for swaps.
updateTransition coordinates several animations driven by one state. It handles multi-state enums, per-property specs via transitionSpec, and child transitions — all with coherent interruption a group of animate*AsState calls cannot give you.
animate*AsState animates toward a target that can change at any moment. Understanding it as declarative rather than imperative explains interruption, redirection, and why spring is the right default.
A List parameter is unstable because the compiler cannot prove it will not change.
Layout measures text to resolve constraints, and a changing style invalidates the cache.
The Compose animation surface looks large because it is organised by what you're animating rather than by how. Three questions pick the right API, and picking wrong is why animation code gets complicated.
A computed value read in composition invalidates on every change of its source. derivedStateOf narrows it to the result.
Hoisting everything to the root means every keystroke recomposes the tree.