paparazzi
paparazzi copied to clipboard
Gif support for Compose
Paparazzi hasn't Gif support for Compose, it should be great if it was added.
Is it possible, as a workaround, to wrap the composable with AndroidView
?
In the meantime, this totally works:
val view = ComposeView(paparazziRule.context)
view.setContent {
PaparazziTestTheme(darkTheme = true) {
Page()
}
}
paparazziRule.gif(view, "test", 0L, 500L, 30)
In the meantime, this totally works:
val view = ComposeView(paparazziRule.context) view.setContent { PaparazziTestTheme(darkTheme = true) { Page() } } paparazziRule.gif(view, "test", 0L, 500L, 30)
Well, it worked but,
It generated a .mov file instead of a .gif in the videos folder.
Also, it generated a bunch of images in the screenshot folder, which I would assume that these are the .gif frames.
Is that the expected result??
lib version used: 1.3.1
Yep, if you look at the source code, that is expected: https://github.com/cashapp/paparazzi/blob/master/paparazzi/src/main/java/app/cash/paparazzi/HtmlReportWriter.kt. The way it works is that every frame is generated, and then assembled in a video.
Arguably, it could be cleaned.
As of now, the snapshot verifier does not verify videos, just fixed images: https://github.com/cashapp/paparazzi/blob/master/paparazzi/src/main/java/app/cash/paparazzi/SnapshotVerifier.kt
Note that there are some gif related PRs open, some might be related: https://github.com/cashapp/paparazzi/pulls?q=is%3Apr+is%3Aopen+gif