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

Viewed 1345

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?

1 Answers

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.

Related