{"id":516798,"date":"2024-10-16T11:58:27","date_gmt":"2024-10-16T10:58:27","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=kotlin&#038;p=516798"},"modified":"2026-05-15T14:05:46","modified_gmt":"2026-05-15T13:05:46","slug":"compose-multiplatform-1-7-0-released","status":"publish","type":"kotlin","link":"https:\/\/blog.jetbrains.com\/zh-hans\/kotlin\/2024\/10\/compose-multiplatform-1-7-0-released","title":{"rendered":"Compose Multiplatform 1.7.0 Released"},"content":{"rendered":"\n<p>Compose Multiplatform is a declarative UI framework built by JetBrains that allows developers to share UI implementations across different platforms. The 1.7.0 release brings more components to common code, support for type-safe navigation, significant performance improvements on iOS, and changes from the latest <a href=\"https:\/\/developer.android.com\/jetpack\/compose\" data-type=\"link\" data-id=\"https:\/\/developer.android.com\/jetpack\/compose\" target=\"_blank\" rel=\"noopener\">Jetpack Compose<\/a> update.<\/p>\n\n\n\n<p>Here are the highlights of this release:<\/p>\n\n\n\n<ul>\n<li>Material3 <code>adaptive<\/code> and <code>WindowSizeClass<\/code> are now available in common code.<\/li>\n\n\n\n<li>Compose Multiplatform now provides compile-time safety for your navigation graph.<\/li>\n\n\n\n<li>Compose Multiplatform 1.7.0 paired with Kotlin 2.0.20 performs significantly faster and smoother on iOS than the combination of previous stable releases.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>For the complete list of changes, refer to our <a href=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/whats-new-compose-170.html\" target=\"_blank\" rel=\"noreferrer noopener\">What\u2019s New page<\/a> or <a href=\"https:\/\/github.com\/JetBrains\/compose-multiplatform\/releases\/tag\/v1.7.0\" target=\"_blank\" rel=\"noreferrer noopener\">release notes on GitHub<\/a>.<\/p>\n\n\n\n<p><p align=\"center\"><a class=\"ek-link jb-download-button\" title=\"Get Started with Compose Multiplatform\" href=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/compose-multiplatform-getting-started.html?utm_source=kotlinblog&amp;utm_medium=cta&amp;utm_campaign=compose-1.7.0\" target=\"_blank\" rel=\"noopener\">Get Started with Compose Multiplatform<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">New common modules<\/h2>\n\n\n\n<p>With Compose Multiplatform 1.7.0, the following components have become available in common code:<\/p>\n\n\n\n<ul>\n<li>Material3 adaptive modules from <code>material3.adaptive<\/code>, such as <code>adaptive<\/code>, <code>adaptive-layout<\/code>, and <code>adaptive-navigation.<\/code><\/li>\n\n\n\n<li>The Material3 adaptive navigation suite.<\/li>\n\n\n\n<li>Material3 <code>WindowSizeClass<\/code> classes.<\/li>\n\n\n\n<li>The <code>material-navigation<\/code> library.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Type-safe navigation<\/h2>\n\n\n\n<p>You can now rely on Compose Multiplatform for compile-time safety in navigation graphs. To ensure type safety, we adopted Jetpack Compose\u2019s type-safe approach to passing objects along a navigation route.<\/p>\n\n\n\n<p><br>See the <a href=\"https:\/\/developer.android.com\/guide\/navigation\/design\/type-safety\" target=\"_blank\" rel=\"noreferrer noopener\">Type safety in Navigation Compose<\/a> guide for API details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Performance improvements on iOS<\/h2>\n\n\n\n<p>In Kotlin 2.0.20, the Kotlin\/Native team contributed significantly to making Compose apps on iOS perform faster and smoother. The Compose Multiplatform 1.7.0 release makes the best of these optimizations, along with performance improvements from Jetpack Compose 1.7.0.<\/p>\n\n\n\n<p>We benchmarked Compose Multiplatform 1.6.11 paired with Kotlin 2.0.0 and Compose Multiplatform 1.7.0 paired with Kotlin 2.0.20, and the comparison shows the following improvements:<\/p>\n\n\n\n<ul>\n<li>The LazyGrid benchmark simulates <code>LazyVerticalGrid<\/code> scrolling, which is closest to real-life use cases, and performs ~9% faster on average. It also shows a significantly reduced number of missed frames. Take a look at the p1\/p50 percentile graph below: It shows increased frame stability and confirms that there are now hardly any missed frames, as the average processing time is less than the standard 8.33 ms latency of a 120Hz iPhone screen.<\/li>\n\n\n\n<li>The VisualEffects benchmark renders many randomly placed components and works 3.6 times faster \u2013 the average CPU time per 1000 frames was reduced from 8.8 to 2.4 seconds.<\/li>\n\n\n\n<li>The <code>AnimatedVisibility<\/code> composable animates showing and hiding an image and demonstrates ~6% faster rendering.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><img decoding=\"async\" loading=\"lazy\" width=\"908\" height=\"620\" class=\"wp-image-517457\" style=\"width: 350px;\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/10\/LazyVerticalGrid_1.7.0.png\" alt=\"Scrolling LazyVerticalGrid\"><\/td><td><img decoding=\"async\" loading=\"lazy\" width=\"908\" height=\"621\" class=\"wp-image-517468\" style=\"width: 350px;\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/10\/VisualEffects_1.7.0.png\" alt=\"Rendering 1000 frames with VisualEffects\"><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Feel free to test it yourself and let us know whether your iOS app feels smoother!<\/p>\n\n\n\n<p>On top of that, Kotlin 2.0.20 introduces experimental support for concurrent marking in the garbage collector (GC). Enabling concurrent marking shortens GC pauses and demonstrates even bigger improvements for all benchmarks. We measured only half as many missed frames as before, as well as a drop in the worst p25 GC pause time from 1.7 ms to 0.4 ms for the LazyGrid benchmark. <a href=\"https:\/\/kotlinlang.org\/docs\/whatsnew2020.html#concurrent-marking-in-garbage-collector\" target=\"_blank\" rel=\"noreferrer noopener\">Give it a try<\/a> and share your feedback.<\/p>\n\n\n\n<p><p align=\"center\"><a class=\"ek-link jb-download-button\" title=\"Update to Compose Multiplatform 1.7.0\" href=\"https:\/\/github.com\/JetBrains\/compose-multiplatform\/releases\/tag\/v1.7.0\" target=\"_blank\" rel=\"noopener\">Update to Compose Multiplatform 1.7.0<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Improved touch interop between Compose Multiplatform and native iOS<\/h2>\n\n\n\n<p>This release improves touch handling for iOS interop views. Imagine a large interop video player used in a scrollable context such as a lazy list \u2013 it would be quite an unpleasant experience to scroll through the list when most of the screen is taken up by a video that intercepts all touches while Compose Multiplatform is unaware of them.<\/p>\n\n\n\n<p>Compose Multiplatform now tries to detect whether a touch is meant for an interop view or should be processed by Compose. This makes it possible to process touch events that happen in a UIKit or a SwiftUI area inside your Compose Multiplatform app.<\/p>\n\n\n\n<p>Check out our <a href=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/compose-ios-touch.html\" target=\"_blank\" rel=\"noreferrer noopener\">Handling touch events with interop on iOS<\/a> documentation page for details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Drag and drop on desktop<\/h2>\n\n\n\n<p>Compose Multiplatform 1.7.0 implements drag and drop for desktop. You can now use the <code>dragAndDropSource<\/code> and <code>dragAndDropTarget<\/code> modifiers to specify which composable is a starting drag point and which one accepts the dropped data.<\/p>\n\n\n                                                <figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/10\/drag_and_drop.gif\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/10\/drag_and_drop.png\" alt=\"Drag and drop on desktop\" width=\"600\" class=\"wp-image-516189\"\/><\/figure>\n                        \n\n\n<h2 class=\"wp-block-heading\">Shared element transitions<\/h2>\n\n\n\n<p>Compose Multiplatform now supports seamless transitions between composables that share consistent elements. These transitions are often useful in navigation, helping users follow the trajectory of changes in the UI. Check out the <a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\/animation\/shared-elements\" target=\"_blank\" rel=\"noreferrer noopener\">Jetpack Compose documentation<\/a> for details on API and Android samples, and give the new animation a try on other platforms.<\/p>\n\n\n                                                <figure class=\"wp-block-image size-full\"><img decoding=\"async\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/10\/ios_shared_element_transitions.gif\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/10\/ios_shared_element_transitions.png\" alt=\"Shared element transitions\" width=\"335\" class=\"wp-image-516222\"\/><\/figure>\n                        \n\n\n<h2 class=\"wp-block-heading\">Resources updates and improvements<\/h2>\n\n\n\n<p>This release brings a variety of updates for resources \u2013 let\u2019s take a look at the most notable ones:<\/p>\n\n\n\n<ul>\n<li>The resource library now supports using test resources in Compose Multiplatform projects.<\/li>\n\n\n\n<li>All multiplatform resources are now packed into Android assets, allowing Android Studio to generate previews for Compose Multiplatform composables in Android source sets.<\/li>\n\n\n\n<li>You can now directly access Android resources via URI from external libraries such as WebView and media player.<\/li>\n\n\n\n<li>The new <code>customDirectory<\/code> setting in the configuration DSL allows you to associate a custom directory with a specific source set.<\/li>\n\n\n\n<li>Resources are now mapped to string IDs for easy access.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What else to read<\/h2>\n\n\n\n<ul>\n<li><a href=\"https:\/\/github.com\/JetBrains\/compose-multiplatform\/releases\/tag\/v1.7.0?utm_source=kotlinblog&amp;utm_medium=blogpost&amp;utm_campaign=compose-1-7-0\" target=\"_blank\" rel=\"noreferrer noopener\">Compose Multiplatform 1.7.0 \u2013 release notes on GitHub<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/whats-new-compose-170.html\" target=\"_blank\" rel=\"noreferrer noopener\">What\u2019s new in Compose Multiplatform 1.7.0 \u2013 detailed release notes on the documentation portal<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/compose-multiplatform-getting-started.html\" target=\"_blank\" rel=\"noreferrer noopener\">Get started with Compose Multiplatform <\/a><a href=\"https:\/\/github.com\/JetBrains\/compose-multiplatform\/releases\/tag\/v1.7.0?utm_source=kotlinblog&amp;utm_medium=blogpost&amp;utm_campaign=compose-1-7-0\" target=\"_blank\" rel=\"noopener\">\u2013<\/a><a href=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/compose-multiplatform-getting-started.html\" target=\"_blank\" rel=\"noopener\"> tutorial<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/compose-multiplatform-and-jetpack-compose.html\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.jetbrains.com\/help\/kotlin-multiplatform-dev\/compose-multiplatform-and-jetpack-compose.html\" rel=\"noreferrer noopener\">Compose Multiplatform and Jetpack Compose<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2024\/08\/kotlin-2-0-20-released\/\" target=\"_blank\" rel=\"noreferrer noopener\">Kotlin 2.0.20 Released <\/a><a href=\"https:\/\/github.com\/JetBrains\/compose-multiplatform\/releases\/tag\/v1.7.0?utm_source=kotlinblog&amp;utm_medium=blogpost&amp;utm_campaign=compose-1-7-0\" target=\"_blank\" rel=\"noopener\">\u2013<\/a><a href=\"https:\/\/blog.jetbrains.com\/kotlin\/2024\/08\/kotlin-2-0-20-released\/\"> blog post<\/a><\/li>\n<\/ul>\n","protected":false},"author":1053,"featured_media":518195,"comment_status":"closed","ping_status":"closed","template":"","categories":[956,907],"tags":[8144,6706,6436],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/516798"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/kotlin"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/1053"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=516798"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/516798\/revisions"}],"predecessor-version":[{"id":551540,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/kotlin\/516798\/revisions\/551540"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/518195"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=516798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=516798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=516798"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=516798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}