Paparazzi 2.0 Design #1711
geoff-powell
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
I think @saket brought up this idea, a |
Beta Was this translation helpful? Give feedback.
2 replies
-
Rename historical
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
👋🏽 Hello,
This discussion will be used to ideate over the next API design of paparazzi.
WIP
Old 2.0 Refactor
Old snapshotter branch
Brainstorming a way to separate our snapshotter interface from the component that renders the views. This could provide a way to allow Paparazzi snapshotting in Robolectric or Espresso tests (KMP when?).
(interceptor pattern)
interface Snapshotter {
fun snapshot(): Snapshot
fun clip(): Clip // Video
}
// Could be future iteration?
(multi-platform apis for other snapshot producers)
// Eventually have LayoutLibEngine, RobolectricEngine, EspressoEngine, SwiftUiEngine, etc.
interface Engine {
fun render(View): BufferedImage
}
// test module
interface TestSnapshotHandler {
fun handleSnapshot(Snapshot, TestRecord)
fun handleClip(Clip, TestRecord)
}
class Paparazzi(...) : TestRule {}}
TODOs
Look into SSIM, FLIP diffing algorithms
Paparazzi annotation accessibility support
Paparazzi code-gen manifest useful for Google Compose snapshots
SDK-ify work needs to be done generating R.jar
SDK paparazzi values need to come from somewhere
Beta Was this translation helpful? Give feedback.
All reactions