Skip to content

Use AnimatedVisibility for the shared location card and MotionPresence - #145

Merged
Tarquinen merged 2 commits into
devfrom
shared-location-animated-visibility
Nov 18, 2026
Merged

Tarquinen merged 2 commits into
devfrom
shared-location-animated-visibility

Conversation

@Tarquinen

@Tarquinen Tarquinen commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

The shared location card's hand-built entrance gate and PresenceGate (the custom "keep mounted while it animates out" helper behind MotionPresence) are replaced with plain AnimatedVisibility, using the same Motion specs, so Reduce Motion still applies. PresenceGate and ComposerLocationEntrance are deleted, along with the tests that only covered them. PresenceGate.kt is renamed MotionPresence.kt, because it still holds MotionPresence, MotionSwap and motionBlurReveal. The parity rows now say these are native on purpose.

Visible differences from dev

  • Dropped blur, settings checkmarks: MotionPose.microIn and MotionPose.swap carry a subtle blur (MotionTunables.blurSubtle). The new MotionPresence drops it. Nothing changes on screen, because transitionBlur already draws nothing on Android.
  • Dropped blur, location card: the old entrance passed metrics.blur to transitionBlur. It is dropped too, again with no change on screen.
  • No offsets lost: the poses these callers use (microIn in, swap out) have no offset. Only roll has one, and MotionPresence never used it.
  • Interrupted swaps: the old checkmark jumped between the entering pose (0.85) and the leaving pose (0.96) when reversed mid-animation. AnimatedVisibility reverses smoothly from where it is.
  • Not visible, only behaviour: while a checkmark is leaving, it no longer blocks touches or hides itself from TalkBack. All callers are decorative icons with no content description.
  • Otherwise the same: the location card still fades in and scales from 0.965 on Motion.layout's Enter spec, and removing it is still instant.

Verified

  • scripts/check.sh passes on the VM. It ran before merging dev; the merge only changed docs/parity/core-ui.md.
  • On the emulator, I recorded dev next to this branch, both at real speed:
    • Location card, against dev 3da8e20: it appears in about 0.3 s on both. Removing it is instant on both, then the row collapses in about 0.25–0.3 s.
    • Theme checkmarks, against dev 92c61d4: the leaving side reaches 90% in about 260 ms on both. The arriving side takes about 500 ms on dev and 530 ms here, within one or two frames of noise.
  • Settings › Appearance › Theme, Settings › Voice › Voice, and Settings › Voice › Delegator (with the experiment on):
    • Selecting another option, and tapping back and forth quickly, looks the same on both builds.
    • At rest there is always exactly one ring or checkmark per row. Mid-swap, both are briefly faint on both builds.
  • Dark mode, while tapping quickly: the same on both builds.
  • Reduce Motion (animator scale 0): each selection snaps in one frame on both builds, with nothing stuck half-shown.

Not tested

  • The devtools Motion Playground.
  • Reduce Motion's fade on its own: animator scale 0 also zeroes the fade, so only the snap was visible.
  • A location that resolves during the take.

Dead code: ComposerView (and so its AttachmentsRow, which I edited) has no callers anywhere in the repo. It is left for the dead-code sweep.

before-after.mp4
before-after.mp4

The shared location card in the composer had its own hand-built
entrance gate (an Animatable driven by gateProgress/onAppear), and
MotionPresence kept a custom PresenceGate to hold content mounted while
it animated out. Both are now plain AnimatedVisibility on the same
Motion specs:

- The location card fades in and scales from 0.965 at its bottom-left
  corner on Motion.layout's Enter spec (fade only under Reduce Motion),
  as before. Removal stays instant; the row height still collapses.
- MotionPresence enters and exits with its role's pose and specs. It no
  longer blocks touches or drops semantics while leaving; its callers
  are decorative checkmarks.
- PresenceGate and ComposerLocationEntrance are deleted, with the tests
  that only covered them; MotionBlurReveal's checks stay.
- PresenceGate.kt is renamed MotionPresence.kt, since it still holds
  MotionPresence, MotionSwap and motionBlurReveal.

Verified: scripts/check.sh via the VM (passes). On the emulator, recorded
dev (3da8e20) and this branch side by side adding and removing a
location twice: appear takes about 0.3 s on both, removal is instant
on both.
…ed-visibility

# Conflicts:
#	docs/parity/core-ui.md
@Tarquinen
Tarquinen merged commit b2d568c into dev Nov 18, 2026
3 checks passed
@Tarquinen Tarquinen mentioned this pull request Nov 18, 2026

This branch was previously deployed

1 inactive deployment
release — 8c4dbea9 Deployed Nov 18, 2026 by Tarquinen via check #479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant