Showkase
Showkase copied to clipboard
Render previews when a preview is annotated with more than one @Preview annotation
Whenever I annotate a composable with two @Preview annotations it no longer exists inside the group that it should (and isn't visible whatsoever in the Components list).
My use case is that I have a preview that looks like this
@Preview(
name = "LargeContainedButton",
group = "Design System",
)
@Preview(
name = "LargeContainedButton • dark",
group = "Design System",
uiMode = Configuration.UI_MODE_NIGHT_YES,
)
@Composable
fun LargeContainedButtonPreview() {
AppTheme {
LargeContainedButton({}) {
Text("Contained Button (Large)")
}
}
}
In order to be able to see both Dark and Day mode on the IDE itself without launching showkase.
I am not sure if there is a better way to do this in the first place which wouldn't produce this problem, but it anyway feels like this should work regardless as it's a normal use case, what do you think?
I do think that since @Preview supports this, we should support it as well. Unsure about the technical feasibility as I'll have to play with it before I can jump to conclusions but I suspect that this should be possible to do.
Hi @vinaygaba, any updates on this?
@iamutkarshtiwari This has been implemented in this PR - https://github.com/airbnb/Showkase/commit/3dffbac3a955804a21357fbb26f9443f040a1650
Closing this issue.