Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an API to snapshot views while avoiding animations #1261

Open
BrianGardnerAtl opened this issue Jan 25, 2024 · 3 comments
Open

Provide an API to snapshot views while avoiding animations #1261

BrianGardnerAtl opened this issue Jan 25, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@BrianGardnerAtl
Copy link
Collaborator

Some views complete rendering after an animation, such as the OutlinedTextField (referenced in #1032). Calling the regular snapshot functions will only grab the first frame which shows the view in an incomplete state. It would be nice to have an API that allowed snapshotting a view after an animation, potentially by specifying a number of frames to skip before taking the snapshot.

@saket
Copy link
Collaborator

saket commented Feb 1, 2024

I'm using robolectric for some of my tests and it has a nice API for skipping frames until no pending layout/measurements are detected. I think paparazzi would also benefit from something similar.

saket added a commit to saket/swipe that referenced this issue Feb 1, 2024
@saket
Copy link
Collaborator

saket commented Feb 1, 2024

FWIW here's a more common example: I am migrating my library from BoxWithConstraints to Box but its causing my tests to fail because I'm no longer receiving a layout size in the first frame: saket/swipe@658ffed

@leo-beliakov
Copy link

@jrodbx Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants