Open JPrendy opened 4 months ago
@JPrendy Thank you for the report! I came across this slide about animation. This is a Japanese slide. But Could you try to use mainClock? https://speakerdeck.com/sumio/a-collection-of-useful-tips-for-taking-screenshots-in-roborazzi?slide=32
@JPrendy
Coil employs an asynchronous method for loading and displaying GIFs with your approach (which is why the painter has the prefix Async
and you have to use an instance of ImageRequest
). It's important to note that using onRoot
does not ensure that the GIF has been rendered; in fact, based on my experience, content loaded asynchronously by Coil typically isn't displayed immediately with onRoot.
To address this issue, you could follow @takahirom's advice and manually advance the clock before capturing an image. However, this method might lead to inconsistencies, especially with GIFs that "animate" (i.e. change over time).
A more reliable solution is to intercept the image/GIF loading process used by Coil, making it behave as if it loads images/GIFs synchronously. This can be achieved by customising the image loader. For detailed guidance on how to implement this, refer to Coil's documentation on testing: Coil Testing Documentation.
Hello,
I am wondering does Roborazzi support coil https://github.com/coil-kt/coil
As I see you have support for generating gif images https://github.com/takahirom/roborazzi?tab=readme-ov-file#generate-gif-image
It would be great if we could take screenshots of gifs themselves with this feature to test the gifs are working correctly.
See my example code below using Roborazzi and Coil where the native image was captured by Roborazzi but the local gif I used being loaded with coil wasn't captured at all.
If Roborazzi doesn't support coil, that is okay, I just thought I would raise it, in case I missed something following the README steps.
The screen in the emulator
The screenshot captured by Roborazzi