Repository navigation
Rebuild the media viewer's motion with standard Compose - #102
Merged
Merged
Conversation
The viewer's open, close, drag to dismiss and predictive back were a hand-built port of iOS's flight: a bitmap copy flown over the app, its own drag, back and recovery paths, and a trace. Now one animated frame and rounded clip moves the media itself: the selected image page draws at it, and video, loading pages and documents move as a whole layer. - Images grow out of their thumbnail and fly home on close, from the zoomed frame when zoomed, and to the swiped-to page's own thumbnail. - Videos grow out of their file card once the first frame is up (up to 1 s), and shrink back on close. - Documents and agent file cards grow from their card; the swipe-down and nested-scroll hand-over are unchanged. - A source that's clipped or off screen gets a fade-and-scale, and Reduce Motion a fade, as before. - The drag keeps MediaDismissDrag's rule, so its tests still apply. - The drawing hand-off into the composer is unchanged (#98). - No SharedTransitionLayout: it would wrap the whole app in a lookahead scope, which broke the composer's model chip and needed frame waits. Removed: the flight layer, the controller's flight, drag, back and touch recovery paths, and MediaTransitionTrace (-824/+494 lines). Checked on the emulator against dev: open, close, drag, spring back, gallery swipe, zoomed close, predictive back, video, PDF, Reduce Motion, dark mode, 2x font, TalkBack focus after close, and all eight hand-off cases. scripts/check.sh passes.
Merged
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The full-screen viewer's motion is now built from standard Compose, so about 330 fewer lines do the same job, and the motion looks the same as before or better.
Before, opening and closing flew a bitmap copy of the image over the app, with its own drag, back, recovery and trace code ported from iOS. Now the media itself moves: one animated frame and rounded clip that the image page draws at, or that the whole page follows for videos, loading pages and documents.
It doesn't use
SharedTransitionLayout: that wraps the whole app, which hid the composer's model chip and needed frame waits to avoid fake transitions. Nothing outside the viewer changes.dev on the left, this PR on the right: open, close, drag, back, then each hand-off case at 1× and 1/4 speed:
viewer-motion-dev-vs-pr.mp4
Checked on the emulator against session-lab at 1× and 0.1× in light and dark, side by side with dev: open and close from a chat image, a gallery, a clipped thumbnail, a video file card and a PDF card; swiping a gallery then closing; drag to dismiss and spring back; back and predictive back (cancel and commit); zoomed close; Reduce Motion; 2× font; TalkBack focus after close. The hand-off matched dev for a chat image, a paused video frame, a re-edited composer photo, a long draft, three images, an overflowing row, a long draft with an overflowing row, and Reduce Motion.
scripts/check.shpasses.Deleted: the flight layer, the controller's flight, drag, back and touch-recovery code, and
MediaTransitionTrace.kt(−824 / +494 lines).