Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added functionality to allow skipping Previews #164

Merged
merged 3 commits into from
Aug 6, 2021

Conversation

vinaygaba
Copy link
Collaborator

@vinaygaba vinaygaba commented Aug 5, 2021

Fixes #158

One of the use cases of Showkase is to treat it as a catalog browser and only highlight specific composables in Showkase. Since Showkase automatically renders all @Preview composables as well, there was no way to skip those only from the Showkase browser. Composables that instead use @ShowkaseComposable can be skipped by merely removing the annotation from the function. However, if you remove the @Preview annotation, you lose out on the ability to see the preview in Android Studio as well. Hence, this PR introduces the ability to skip a composable from Showkase while retaining the ability to see the preview in Android Studio. All you need to do is to add the ShowkaseComposable annotation with the skip property. Here's an example

@ShowkaseComposable(skip = true)
@Preview(group = "Scrollable", name = "Vertical Scroll", showBackground = true)
@Composable
fun VerticalScrollPreview() {
    VerticalScrollSample()
}

@BenSchwab @elihart

@vinaygaba vinaygaba merged commit 65ac534 into master Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to omit preview composables from showkase
2 participants