1.0.0-beta18
- Added support for custom preview annotations (#303).
You can now create another annotation class that's annotated with @Preview
and Showkase will ensure that the @Preview
properties are applied whenever you use the custom annotation. Here's an example
@Preview(name = "Custom Preview One First", group = "Custom Previews")
@Preview(name = "Custom Preview One Second", group = "Custom Previews")
annotation class MyCustomPreview
// This custom annotation can now be used to represent previews
@MyCustomPreview
@Composable
fun CustomAnnotationPreview() {
}
This was contributed by @oas004 and required a lot of diligence 👏🏻
- Experimental Added a new artifact
showkase-screenshot-testing-paparazzi
that provides a mechanism to automate screenshot testing for your codebase using Showkase + Paparazzi (#294).
Assuming that you were already using Showkase, you just need 3 lines of code in the test
sourceset of your root module to automatically screenshot test all your previews in the default configuration.
@ShowkaseScreenshot(rootShowkaseClass = YourShowkaseRootModuleClass::class)
abstract class MyPaparazziShowkaseScreenshotTest: PaparazziShowkaseScreenshotTest {
companion object: PaparazziShowkaseScreenshotTest.CompanionObject
}
In our own usage, we've found issues with using Paparazzi when the codebase has a large number of screenshot and haven't quite figured out what's causing it (cashapp/paparazzi#630). As a result, try at your own risk. Having said that, we are really keen on resolving the linked issue and deploying this. If you have any insights about this issue, please reach out!
- Other misc documentation updates and fixes