Android Jetpack Compose Previews: Beyond the Basics

Previews are an important feature of Jetpack Compose that you can use to verify Composables without having to run the app. In addition to just viewing the default preview, you can use the @Preview annotation to test your Composables against different configuration sets, font sizes, themes, and datasets. You can even preview Compose animations and also use Inpect Mode to account for runtime behavior.

In this coffee break codelab, you'll explore:
  • Configuring Previews 
  • Switching Themes to Preview Composables in Dark Mode
  • Combining Preview configurations 
  • Mutlipreview annotations 
  • Dataset Driven Previews 
  • Inspect Mode to Have Preview-Only behavior
  • Handling ViewModels to Work with Previews
  • Animation Previews 

Meet the instructor

Subhrajyoti Sen

Content Author & Course Instructor

More courses by the instructor