Kostya Dzyuba
Kostya Dzyuba

Reputation: 511

How do I disable the composable preview in Android Jetpack Compose?

I have several composables with a preview in my activity. they take a long time to render, and I only need to check one composable. How do I disable the composable preview in Android Jetpack Compose?

Upvotes: 9

Views: 3526

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363955

You could use the group attribute in the Preview.

Something like:

@Composable
@Preview(group="Test")
fun test1(){ }

Then in the Preview panel you can select the preview group:

enter image description here

In this way you can select the preview to be displayed.

Upvotes: 13

Related Questions