ProAndroidDev

The latest posts from Android Professionals and Google Developer Experts.

Follow publication

First steps in Jetpack Compose, Part 1 — the power of @Preview

Zhelyazko ("Zheko") Atanasov
ProAndroidDev
Published in
8 min readSep 29, 2020

Basics

Name & Group

Showing all Composable previews in the group “Star Wars”

Background

Width & Height

Decoration

You can always zoom-in and see your composable in more details :-)

Add multiple @Preview annotations to a Composable

Advanced use cases

@Preview-annotated composable function with an input parameter

What about multiple input parameters?

Option 1: Use a wrapper class for the parameters

Extending CollectionPreviewParameterProvider is another way to provide preview parameters

Option 2: Combine multiple PreviewParameterProviders into one

Interactive Previews

Running a Preview on an emulator or real device

Running a Preview within Android Studio

Final thoughts

Useful links

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in ProAndroidDev

The latest posts from Android Professionals and Google Developer Experts.

Responses (1)

Write a response