Tools for Compose
Android Studio brings a lot of new features specifically for Jetpack Compose. It embraces a code-first approach while improving the developer productivity without having to choose between using design interface or code editor.
A fundamental difference between View-based UI and Jetpack Compose is that Compose doesn't rely on View
to render its composables. As a consequence of this architecture approach, Android Studio offers extended features for Jetpack Compose without having to open an emulator or connect to a device. Compared to Android Views, this allows a faster, iterative process for developers to implement their UI designs.
To enable Android Studio-specific features for Jetpack Compose, you need to add these dependencies in your application build.gradle
file:
debugImplementation "androidx.compose.ui:ui-tooling:1.4.2" implementation "androidx.compose.ui:ui-tooling-preview:1.4.2"
Design
Preview your UI
@Preview
annotation allows you to preview your composables. Learn how to preview, organize, and interact with them.