This article has participated in the good article call order activity, click to see: back end, big front end double track submission, 20,000 yuan prize pool for you to challenge!

Anna-chiara Bellini, Product Manager, Nick Butcher, Developer Relations

The original address: android-developers.googleblog.com/2021/07/jet…

Wechat official account: Jetpack Compose Museum

Today, we are officially launching Jetpack Compose version 1.0. A modern toolkit for building native Android UIs, Jetpack Compose simplifies and speeds up UI development on Android with less code, more powerful tools, and a more intuitive Kotlin API.

For the past two years, we’ve been developing Compose and getting feedback and engagement from the Android community. By the time we released version 1.0, there were over 2,000 apps using Compose on Google Play. In fact, the Google Play app itself is using Compose! But that’s not all. We’ve been working with some of the top app developers, and their feedback and support has helped us make version 1.0 even more powerful. For example, Square told us that by using Compose, they can focus more on things that are specific to their UI infrastructure, rather than addressing the broader problem of building a declarative UI framework. Monzo says Compose allows them to “build higher quality UI effects faster.” Twitter sums it up pretty well.” We love it! ❤ ️”

We designed Compose to make building native Android apps faster and easier. In a completely declarative way, you only need to describe your user interface, and Compose handles the rest. As the state of your application changes, your UI automatically updates, making it easier to build a UI quickly. The intuitive Kotlin API helps you build beautiful applications with less code, and native access to all the existing Android code means you can use it as you see fit. The powerful layout API and code-driven UI system make it easy to support different end devices such as tablets and foldable devices. Jetpack Compose also supports WearOS, screen widgets, and more.

Jetpack Compose version 1.0 is now available for use in production environments, and the key features you need are provided below.

  • Interoperable: Compose is very well interoperable with View, and you can embed Compose in View or embed View in Compose. You can add a button to the screen, or you can keep the custom view you created in the current Compose.
  • Integrate the Jetpack Component libraries: Compose is designed to integrate with the Jetpack libraries you know and love. With integration with Navigation, Paging, LiveData (or Flow/RxJava), ViewModel, and Hilt, Compose can be used with your existing architecture.
  • Material: Compose provides an implementation of Material Design components and themes that make it easy to build beautiful applications. The Material theme system is easier for developers to understand and track, eliminating the need to consult multiple XML files.
  • Lists: Compose’s Lazy component provides a simple, concise, but powerful way to display lists of data efficiently with a minimum of boilerplate code.
  • Animation: Compose’s simple and coherent animation API makes it easier to entertain your application users.

A new UI building experience

The fully declarative approach in Jetpack Compose fundamentally changes the way you develop your UI. To support new workflows and a different way of thinking, we’ve provided new tools designed specifically for Compose, and added support for Compose to some of our existing tools.

Compose a preview

The Compose Preview feature is available in Android Studio Arctic Fox, which makes component development easier by allowing you to view the Compose component in different states, light and dark themes, or different font scales at the same time. There is no need to deploy the entire application to your device. Enhanced real-time literal editing capabilities will allow you to see the modified UI without having to recompile the project.

Preview the standalone deployment of components

If you’ve ever wanted to be able to test parts of the UI on your device without having to navigate through your application to the page you’re working on, you’ll love the new deployment Preview functionality. Just add the @Preview annotation to your Compose component, The preview window allows you to deploy the Compose component independently on your device for iterative testing.

Support Layout Inspector

The Layout Inspector adds support for the Compose component, so you can confidently mix it with an existing View. Read more about Compose support in Android Studio Arctic Fox here.

Compose Roadmap

Adoption of any new framework requires evaluation, especially something as far-reaching as the new UI toolkit. To help you make an informed decision as to whether this is the right time for you, we have released a public Roadmap to share our plans to continue building Jetpack Compose.

Learning to Compose

To help you learn about Compose, we have a number of learning resources for you and your team.

Tutorial: Get a quick look at Compose in action and a taste of declarative programming. Documentation: From basic topics like how to think in Compose and understand state flow or architecture hierarchies, to guidance on key apis like layout, navigation, or testing, to developer ergonomics or tool functionality considerations — we provide guidance for each topic. Codelabs: If you prefer hands-on learning, we offer nine Codelabs to actually teach you all about Compose (check out our new Advanced State & Side Effects Codelab). Video: Grab some 🍿, then sit down and learn all about Compose. Example: Eight official examples show a series of apis and use cases. Chinese Manual: For Chinese Android developers, there is a Compose Chinese project initiated by domestic Compose enthusiasts, aiming to help Chinese Android developers better understand and master the Compose framework. Welcome to join us!

There’s a lot to learn! The Jetpack Compose Pathway offers a step-by-step journey through code LABS, videos, and documentation to help guide you.

Enjoy Composing

We firmly believe Jetpack Compose is a big step forward in making building great UIs faster and easier. We can’t wait to see what applications you build with it. Now that Compose is stabilizing in version 1.0, it’s time to start working on my Composing!