{"id":231611,"date":"2024-06-12T21:55:40","date_gmt":"2024-06-12T21:55:40","guid":{"rendered":"https:\/\/michigandigitalnews.com\/index.php\/2024\/06\/12\/whats-new-in-jetpack-compose-at-i-o-24\/"},"modified":"2025-06-25T17:17:15","modified_gmt":"2025-06-25T17:17:15","slug":"whats-new-in-jetpack-compose-at-i-o-24","status":"publish","type":"post","link":"https:\/\/michigandigitalnews.com\/index.php\/2024\/06\/12\/whats-new-in-jetpack-compose-at-i-o-24\/","title":{"rendered":"What\u2019s new in Jetpack Compose at I\/O \u201824"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div>\n<meta content=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjiHsgx03_pIhu49ZCTyXVL6E4fv9gcl03Ze2FBajjx3tEjA4jP3ywIVSQeE09YfkPDpGGqa2odqrbeSABDs10Q_TbP4r5MSvvUenhggHVq0HMiPqfvrIZDywm3GSDZqxdKqqaI_cdfZ0PFdUzKNgqsVYjW2IP2FkoOzSrcx6zNvxlMrNR31qEdf4_o-rU\/s1600\/social-What%E2%80%99s-new-in-Jetpack-Compose-at-IO-24.png\" name=\"twitter:image\"\/><br \/>\n<img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjiHsgx03_pIhu49ZCTyXVL6E4fv9gcl03Ze2FBajjx3tEjA4jP3ywIVSQeE09YfkPDpGGqa2odqrbeSABDs10Q_TbP4r5MSvvUenhggHVq0HMiPqfvrIZDywm3GSDZqxdKqqaI_cdfZ0PFdUzKNgqsVYjW2IP2FkoOzSrcx6zNvxlMrNR31qEdf4_o-rU\/s1600\/social-What%E2%80%99s-new-in-Jetpack-Compose-at-IO-24.png\" style=\"display: none;\"\/><\/p>\n<p><em>Posted by Ben Trengrove \u2013 Developer Relations Engineer, and Nick Butcher \u2013 Product Manager for Jetpack Compose<\/em><\/p>\n<p><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhe8ysY9PjhnMfmY1OASEvKI1hyphenhyphenLh-oAIrrlUAb87og0ZesmAVlf7_JauqiIG9gttYy7Y1O4D7YRZY0jzcH4lgS5QZCU3OSptHYh7bg9jlUYONoGyWG2L4zYTNTYj8YPIoq0n6bCfwTabXJeyE09ZQYbZzHKXDwPEdVy2Ti5wO69jIdAqQxa1l7HR-A3-Q\/s1600\/HEADER-What%E2%80%99s-new-in-Jetpack-Compose-at-IO-24%20%281%29.png\"><img decoding=\"async\" border=\"0\" data-original-height=\"800\" data-original-width=\"100%\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhe8ysY9PjhnMfmY1OASEvKI1hyphenhyphenLh-oAIrrlUAb87og0ZesmAVlf7_JauqiIG9gttYy7Y1O4D7YRZY0jzcH4lgS5QZCU3OSptHYh7bg9jlUYONoGyWG2L4zYTNTYj8YPIoq0n6bCfwTabXJeyE09ZQYbZzHKXDwPEdVy2Ti5wO69jIdAqQxa1l7HR-A3-Q\/s1600\/HEADER-What%E2%80%99s-new-in-Jetpack-Compose-at-IO-24%20%281%29.png\"\/><\/a><\/p>\n<p>At Google I\/O 2024, we announced the upcoming June \u201824 Jetpack Compose release, packed with features designed to make Android development faster and easier, no matter what form factor you are building for. We also announced expanded Compose support across the ecosystem of Android devices. This post provides an overview of all the announcements, in case you missed any.<\/p>\n<h3>Compose June \u201824 release <\/h3>\n<p><a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\" target=\"_blank\" rel=\"noopener\">Compose<\/a> is Android&#8217;s modern, native UI toolkit that is <a href=\"https:\/\/developer.android.com\/jetpack\/compose#apps-built-with-compose\" target=\"_blank\" rel=\"noopener\">used by apps<\/a> such as <a href=\"https:\/\/android-developers.googleblog.com\/2023\/10\/meta-built-threads-in-only-5-months-using-jetpack-compose.html\" target=\"_blank\" rel=\"noopener\">Threads<\/a>, <a href=\"https:\/\/android-developers.googleblog.com\/2024\/04\/google-drive-cut-code-and-development-time-in-half-with-jetpack-compose-and-new-architecture.html\" target=\"_blank\" rel=\"noopener\">Google Drive<\/a>, and <a href=\"https:\/\/android-developers.googleblog.com\/2024\/05\/soundcloud-supported-more-screens-with-jetpack-compose.html\" target=\"_blank\" rel=\"noopener\">SoundCloud<\/a>. This release adds major features you have been asking for, including shared element transitions and list reordering animations, and improves performance.<\/p>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Shared element transitions<\/span><\/h4>\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjbUo5RnrBoOsutrYVGiLIWZ16yIsll5cxnaSo9Gm4mXwl29MA_fVpwM0wH_RhRrehS9kJRnRISkEVW3yoTkhyT0GUEWg8kGCByRD2Gf0FOIJj9dyLD6NJYtOt4l-Vd_FEkJVj4DRNeu_G5fzwU34Dhq_Gv3dKozTq3iAcOrcHvS4o2WDHGDchZC-zhZL8\/s800\/image7.gif\" style=\"display: block; padding: 1em 0px; text-align: center;\"><img decoding=\"async\" alt=\"\" border=\"0\" data-original-height=\"450\" data-original-width=\"800\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjbUo5RnrBoOsutrYVGiLIWZ16yIsll5cxnaSo9Gm4mXwl29MA_fVpwM0wH_RhRrehS9kJRnRISkEVW3yoTkhyT0GUEWg8kGCByRD2Gf0FOIJj9dyLD6NJYtOt4l-Vd_FEkJVj4DRNeu_G5fzwU34Dhq_Gv3dKozTq3iAcOrcHvS4o2WDHGDchZC-zhZL8\/s600\/image7.gif\" width=\"600\"\/><\/a><\/div>\n<p><span style=\"color: #0d904f; font-family: courier;\"><br \/>\nModifier.sharedElement()<\/span> and <span style=\"color: #0d904f; font-family: courier;\">Modifier.sharedBounds()<\/span> have been added to Compose. They allow you to create beautiful transitions between screens with finer control than the View system allowed. Wrap your <span style=\"color: #0d904f; font-family: courier;\">AnimatedContent<\/span> composables in <span style=\"color: #0d904f; font-family: courier;\">SharedTransitionLayout<\/span> and then add the <span style=\"color: #0d904f; font-family: courier;\">Modifier.sharedElement()<\/span> or <span style=\"color: #0d904f; font-family: courier;\">Modifier.sharedBounds()<\/span> onto the content that you\u2019d like to share between screens. Compose will then find composables with matching keys and smoothly transition between them.<\/p>\n<p>Navigation Compose and predictive back animations in Android 15 also work smoothly together with shared element transitions. This allows you to create screen transitions directly tied to the navigation gesture, which provides a high quality user experience.<\/p>\n<p>Check out the <a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\/animation\/shared-elements\" target=\"_blank\" rel=\"noopener\">documentation<\/a> for more information.<\/p>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Lazy list item animations<\/span><\/h4>\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi7dbU1yGsWEkVZ5MEXSlPpHoQ2JqrVLIy63DFINdPZO-ij5LDFpm0qyMYvLZBJN_Zjli4jARVKkuzU0rM-R7hVBQYSrSDy3IR-7vEEvpaxoGLmh6qz9c8-3cTUMfv93P1QsGSijqEUI9LybJhVtX1XILuG2_EV-G7xkbVdeKNLQvfMTm4fgvarvMxxX9c\/s2340\/chat.gif\" style=\"display: block; padding: 1em 0px; text-align: center;\"><img decoding=\"async\" alt=\"\" border=\"0\" data-original-height=\"2340\" data-original-width=\"1080\" height=\"600\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi7dbU1yGsWEkVZ5MEXSlPpHoQ2JqrVLIy63DFINdPZO-ij5LDFpm0qyMYvLZBJN_Zjli4jARVKkuzU0rM-R7hVBQYSrSDy3IR-7vEEvpaxoGLmh6qz9c8-3cTUMfv93P1QsGSijqEUI9LybJhVtX1XILuG2_EV-G7xkbVdeKNLQvfMTm4fgvarvMxxX9c\/s600\/chat.gif\"\/><\/a><\/div>\n<p>Lazy row and column now have the ability to automatically animate the insertion, removal, and reordering of items. Just add <span style=\"color: #0d904f; font-family: courier;\">Modifier.animateItem()<\/span> to your list items and changes will automatically animate. You can also customize the animation by providing different animation specifications.<\/p>\n<p>Check out the <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/lazy\/LazyItemScope#(androidx.compose.ui.Modifier).animateItem(androidx.compose.animation.core.FiniteAnimationSpec,androidx.compose.animation.core.FiniteAnimationSpec,androidx.compose.animation.core.FiniteAnimationSpec)\" target=\"_blank\" rel=\"noopener\">documentation<\/a> for the instructions.<\/p>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Text<\/span><\/h4>\n<p>Text now supports inline links and basic HTML formatting via the new <span style=\"font-family: courier;\"><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/ui\/text\/AnnotatedString.Companion#(androidx.compose.ui.text.AnnotatedString.Companion).fromHtml(kotlin.String,androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.LinkInteractionListener)\" target=\"_blank\" rel=\"noopener\">AnnotatedString.fromHtml()<\/a><\/span> extension. This converts basic HTML formatting, including links to an <span style=\"font-family: courier;\" target=\"_blank\"><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/ui\/text\/AnnotatedString\">AnnotatedString<\/a><\/span>, which can then be rendered by Compose.<\/p>\n<p><span style=\"font-family: courier;\" target=\"_blank\"><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/text\/package-summary#BasicTextField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.ui.text.TextStyle,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.KeyboardActionHandler,androidx.compose.foundation.text.input.TextFieldLineLimits,kotlin.Function2,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Brush,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.text.input.TextFieldDecorator,androidx.compose.foundation.ScrollState)\" target=\"_blank\" rel=\"noopener\">BasicTextField<\/a><\/span> gains a new overload that accepts a <span style=\"font-family: courier;\"><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/text\/input\/TextFieldState\" target=\"_blank\" rel=\"noopener\">TextFieldState<\/a><\/span>; a new rich state object that allows more robust user experiences (such as rich content like keyboard gifs) and can be hoisted out of the component and updated asynchronously.<\/p>\n<blockquote>\n<p>Note: Material <span style=\"color: #0d904f; font-family: courier;\">TextField<\/span> will be updated to use the new <span style=\"color: #0d904f; font-family: courier;\">BasicTextField<\/span> in a subsequent release, but if you\u2019d like to try it out in your apps, see the <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/text\/package-summary#BasicTextField(androidx.compose.foundation.text.input.TextFieldState,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.foundation.text.input.InputTransformation,androidx.compose.ui.text.TextStyle,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.input.KeyboardActionHandler,androidx.compose.foundation.text.input.TextFieldLineLimits,kotlin.Function2,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Brush,androidx.compose.foundation.text.input.OutputTransformation,androidx.compose.foundation.text.input.TextFieldDecorator,androidx.compose.foundation.ScrollState)\" target=\"_blank\" rel=\"noopener\">documentation<\/a>.<\/p>\n<\/blockquote>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Contextual Flow Layouts<\/span><\/h4>\n<p>\nA commonly requested layout is a lazy flow layout that only composes the content that can fit. If you have ever needed this functionality, <span style=\"font-family: courier;\"><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/layout\/package-summary#ContextualFlowRow(kotlin.Int,androidx.compose.ui.Modifier,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,kotlin.Int,kotlin.Int,androidx.compose.foundation.layout.ContextualFlowRowOverflow,kotlin.Function2)\" target=\"_blank\" rel=\"noopener\">ContextualFlowRow<\/a><\/span> and <span style=\"font-family: courier;\"><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/layout\/package-summary#ContextualFlowColumn(kotlin.Int,androidx.compose.ui.Modifier,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.Arrangement.Horizontal,kotlin.Int,kotlin.Int,androidx.compose.foundation.layout.ContextualFlowColumnOverflow,kotlin.Function2)\" target=\"_blank\" rel=\"noopener\">ContextualFlowColumn<\/a><\/span> are for you. Given a max number of lines, the flow layout will compose as many items that can fit and then provide you the context of what was rendered. With this context, you can then render a custom expand indicator that shows a count of remaining items.<\/p>\n<div style=\"background: rgb(255, 255, 255); border: 0px; overflow: auto; width: auto;\">\n<pre style=\"line-height: 125%; margin: 0px;\"><span style=\"font-family: courier;\"><span style=\"color: #555555; font-weight: bold;\">@OptIn<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #997700; font-weight: bold;\">ExperimentalLayoutApi:<\/span><span style=\"color: #333333;\">:<\/span>class<span style=\"color: #333333;\">)<\/span>\n<span style=\"color: #555555; font-weight: bold;\">@Composable<\/span>\n<span style=\"color: #008800; font-weight: bold;\">private<\/span> fun <span style=\"color: #0066bb; font-weight: bold;\">SuggestedSnacks<\/span><span style=\"color: #333333;\">(<\/span>\n   <span style=\"color: #997700; font-weight: bold;\">snacks:<\/span> List<span style=\"color: #333333;\">&lt;<\/span>Snack<span style=\"color: #333333;\">&gt;,<\/span>\n   <span style=\"color: #997700; font-weight: bold;\">onSnackClick:<\/span> <span style=\"color: #333333;\">(<\/span>Snack<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">-&gt;<\/span> Unit<span style=\"color: #333333;\">,<\/span>\n   <span style=\"color: #997700; font-weight: bold;\">modifier:<\/span> Modifier <span style=\"color: #333333;\">=<\/span> Modifier\n<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\n   var maxLines by remember <span style=\"color: #333333;\">{<\/span> mutableIntStateOf<span style=\"color: #333333;\">(<\/span><span style=\"color: #0000dd; font-weight: bold;\">1<\/span><span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">}<\/span>\n   ContextualFlowRow<span style=\"color: #333333;\">(<\/span>\n       maxLines <span style=\"color: #333333;\">=<\/span> maxLines<span style=\"color: #333333;\">,<\/span>\n       overflow <span style=\"color: #333333;\">=<\/span> ContextualFlowRowOverflow<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">expandIndicator<\/span> <span style=\"color: #333333;\">{<\/span>\n           val remainingItems <span style=\"color: #333333;\">=<\/span> totalItemCount <span style=\"color: #333333;\">-<\/span> shownItemCount\n           MyOverflowIndicator<span style=\"color: #333333;\">(<\/span>\n               remainingItems <span style=\"color: #333333;\">=<\/span> remainingItems<span style=\"color: #333333;\">,<\/span>\n               modifier <span style=\"color: #333333;\">=<\/span> Modifier\n                   <span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">clickable<\/span> <span style=\"color: #333333;\">{<\/span>\n                       <span style=\"color: #888888;\">\/\/ Expand the max lines on click<\/span>\n                       maxLines <span style=\"color: #333333;\">+=<\/span> <span style=\"color: #0000dd; font-weight: bold;\">1<\/span>\n                   <span style=\"color: #333333;\">}<\/span>\n           <span style=\"color: #333333;\">)<\/span>\n       <span style=\"color: #333333;\">},<\/span>\n       itemCount <span style=\"color: #333333;\">=<\/span> snacks<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">size<\/span>\n   <span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span> index <span style=\"color: #333333;\">-&gt;<\/span>\n       val snack <span style=\"color: #333333;\">=<\/span> snacks<span style=\"color: #333333;\">[<\/span>index<span style=\"color: #333333;\">]<\/span>\n       SnackItem<span style=\"color: #333333;\">(<\/span>snack<span style=\"color: #333333;\">,<\/span> onSnackClick<span style=\"color: #333333;\">)<\/span>\n   <span style=\"color: #333333;\">}<\/span>\n<span style=\"color: #333333;\">}<\/span><\/span>\n<\/pre>\n<\/div>\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEiUK3oiK_cEPWbi7Kh0n6rAKndoGs-WK0318nNouv_G_MeceNPwS6P5vQR-4HmqaVUpLiNPh-M_W_nmPpYIiL6i_IKlDenHRpgyTMrpjcD4kOpiuIO619BYNFP8kK209gLIfLyxVIt_0zOuN4WuD1hyphenhypheny_RoBEuA3d7n69y86pbA8PMFYLDYnNYpIFSdNhw\/s1999\/image6.png\" style=\"display: block; padding: 1em 0px; text-align: center;\"><img fetchpriority=\"high\" decoding=\"async\" alt=\"\" border=\"0\" data-original-height=\"1999\" data-original-width=\"900\" height=\"640\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEiUK3oiK_cEPWbi7Kh0n6rAKndoGs-WK0318nNouv_G_MeceNPwS6P5vQR-4HmqaVUpLiNPh-M_W_nmPpYIiL6i_IKlDenHRpgyTMrpjcD4kOpiuIO619BYNFP8kK209gLIfLyxVIt_0zOuN4WuD1hyphenhypheny_RoBEuA3d7n69y86pbA8PMFYLDYnNYpIFSdNhw\/w288-h640\/image6.png\" width=\"288\"\/><\/a><\/div>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Performance improvements<\/span><\/h4>\n<p>Jetpack Compose continues to get faster with every release. We are pleased to report that we have improved the time to first pixel benchmark of our Jetsnack sample by 17% compared to the January release. We gained these improvements simply by updating the sample app to the new Compose version. The chart below shows the improvement in Jetsnack with each Compose release, since the August 2023 release we have nearly halved the time to first pixel drawn of Jetsnack.<\/p>\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEiy7oVbTf4851yshDUn1s6xbxrWW-A-Pv28Arz2TTqQZdnFtgf3ntUMpfuzh5g_vJVrUs-i2GCrNqX63_WNxjZWIClKNvlNAjqV9si97hkuuxduiaItXjBgahtdLGf13Vj8zhcQnpNInrMfLLfTu6x1CdG5qyOc4PZSwpHKOSXG72YxFex6VVuovvIb7c8\/s1514\/image2.png\" style=\"display: block; padding: 1em 0px; text-align: center;\"><img decoding=\"async\" alt=\"\" border=\"0\" data-original-height=\"1040\" data-original-width=\"1514\" height=\"439\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEiy7oVbTf4851yshDUn1s6xbxrWW-A-Pv28Arz2TTqQZdnFtgf3ntUMpfuzh5g_vJVrUs-i2GCrNqX63_WNxjZWIClKNvlNAjqV9si97hkuuxduiaItXjBgahtdLGf13Vj8zhcQnpNInrMfLLfTu6x1CdG5qyOc4PZSwpHKOSXG72YxFex6VVuovvIb7c8\/w640-h439\/image2.png\" width=\"640\"\/><\/a><\/div>\n<p>The indication APIs have been rewritten to allow for lazy creation of ripples, which is very important for scroll performance. For most apps, there should be no changes required, but upgrading might introduce breaking changes if you have custom indications. For help with the migration, see the new <a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\/touch-input\/user-interactions\/migrate-indication-ripple\" target=\"_blank\" rel=\"noopener\">documentation<\/a>.<\/p>\n<p>We continue to improve the efficiency of the Compose runtime, which speeds up all Compose code in your app. We\u2019ve re-engineered the slot table to a more efficient data structure, and we are also generating more efficient code by detecting and removing unused composition groups. Additionally, there are new <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/lazy\/LazyListPrefetchStrategy\" target=\"_blank\" rel=\"noopener\">APIs<\/a> that now allow you to customize the behavior of lazy layout prefetching.<\/p>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Strong skipping mode<\/span><\/h4>\n<p>Strong skipping mode has graduated from experimental status and is now production-ready\u2014the upcoming 2.0.20 compiler release will enable this feature by default. Strong skipping mode simplifies composable skipping by allowing composables with unstable parameters to be skipped. This means more composables will skip automatically, reducing the need to manually annotate classes as stable. The <a href=\"https:\/\/github.com\/android\/nowinandroid\" target=\"_blank\" rel=\"noopener\">Now In Android<\/a> sample saw a 20% improvement in home screen recomposition time when enabling strong skipping. For more details see <a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\/performance\/stability\/strongskipping\" target=\"_blank\" rel=\"noopener\">the documentation<\/a>.<\/p>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Compose compiler moving to the Kotlin repository<\/span><\/h4>\n<p>In case you missed our previous <a href=\"https:\/\/android-developers.googleblog.com\/2024\/04\/jetpack-compose-compiler-moving-to-kotlin-repository.html\" target=\"_blank\" rel=\"noopener\">announcement<\/a>, the Compose compiler will be hosted in the Kotlin repository from Kotlin 2.0. This means you will no longer have to wait for a matching Compose compiler to be released to upgrade your Kotlin version. For full details on this change and to learn about the new Compose Compiler Gradle plugin, see our <a href=\"https:\/\/android-developers.googleblog.com\/2024\/04\/jetpack-compose-compiler-moving-to-kotlin-repository.html\" target=\"_blank\" rel=\"noopener\">announcement blog post<\/a>.<\/p>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Stable APIs<\/span><\/h4>\n<p>We continue to stabilize experimental APIs and remove experimental annotations. Notable APIs for this release include <a href=\"https:\/\/developer.android.com\/develop\/ui\/compose\/layouts\/pager\" target=\"_blank\" rel=\"noopener\"><span style=\"font-family: courier;\">Pager<\/span><\/a>, <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/foundation\/gestures\/AnchoredDraggableState\" target=\"_blank\" rel=\"noopener\"><span style=\"font-family: courier;\">AnchoredDraggable<\/span><\/a>, <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/material3\/package-summary#(androidx.compose.material3.MultiChoiceSegmentedButtonRowScope).SegmentedButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.compose.material3.SegmentedButtonColors,androidx.compose.foundation.BorderStroke,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0,kotlin.Function0)\" target=\"_blank\" rel=\"noopener\"><span style=\"font-family: courier;\">SegmentedButton<\/span><\/a>, <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/material3\/package-summary#SwipeToDismissBox(androidx.compose.material3.SwipeToDismissBoxState,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Function1)\" target=\"_blank\" rel=\"noopener\"><span style=\"font-family: courier;\">SwipeToDismissBox<\/span><\/a>, <a href=\"https:\/\/developer.android.com\/reference\/kotlin\/androidx\/compose\/material3\/package-summary#Slider(androidx.compose.material3.SliderState,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.compose.material3.SliderColors,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function1,kotlin.Function1)\" target=\"_blank\" rel=\"noopener\"><span style=\"font-family: courier;\">Slider<\/span><\/a>, and more.<\/p>\n<h3>Compose support across Android form factors<\/h3>\n<p>We continue to extend Jetpack Compose to all Android form factors to make it faster and easier to build beautiful Android apps, no matter what Android form factor you are targeting. At I\/O this year we announced a number of updates to support building layouts that <a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/compose-material3-adaptive\" target=\"_blank\" rel=\"noopener\">adapt across screen sizes<\/a>, <a href=\"https:\/\/developer.android.com\/training\/tv\/playback\/compose\" target=\"_blank\" rel=\"noopener\">Compose for TV<\/a> reaching 1.0 Beta and updates to <a href=\"https:\/\/developer.android.com\/training\/wearables\/compose\" target=\"_blank\" rel=\"noopener\">Compose for Wear OS<\/a>.<\/p>\n<h3>Jetpack Libraries<\/h3>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">Type safe navigation in Navigation Compose<\/span><\/h4>\n<p>As of Jetpack Navigation 2.8.0-alpha08, the Navigation Component has a full type safe system based on Kotlin Serialization for defining your navigation graph when using our Kotlin DSL, designed to work best with integrations like Navigation Compose.<\/p>\n<p>Now, you can define your navigation destinations and parameters as serializable objects.<\/p>\n<div style=\"background: rgb(255, 255, 255); border: 0px; overflow: auto; width: auto;\">\n<pre style=\"line-height: 125%; margin: 0px;\"><span style=\"font-family: courier;\"><span style=\"color: #888888;\">\/\/ Define a home destination that doesn't take any arguments<\/span>\n<span style=\"color: #555555; font-weight: bold;\">@Serializable<\/span>\nobject Home\n\n<span style=\"color: #888888;\">\/\/ Define a profile destination that takes an ID<\/span>\n<span style=\"color: #555555; font-weight: bold;\">@Serializable<\/span>\ndata <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #0066bb; font-weight: bold;\">Profile<\/span><span style=\"color: #333333;\">(<\/span>val <span style=\"color: #997700; font-weight: bold;\">id:<\/span> String<span style=\"color: #333333;\">)<\/span>\n<\/span><\/pre>\n<\/div>\n<p>Then, when defining your <span style=\"color: #0d904f; font-family: courier;\">NavGraph<\/span>, passing the object is enough. No more route strings!<\/p>\n<div style=\"background: rgb(255, 255, 255); border: 0px; overflow: auto; width: auto;\">\n<pre style=\"line-height: 125%; margin: 0px;\"><span style=\"font-family: courier;\">NavHost<span style=\"color: #333333;\">(<\/span>navController<span style=\"color: #333333;\">,<\/span> startDestination <span style=\"color: #333333;\">=<\/span> Home<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\n    composable<span style=\"color: #333333;\">&lt;<\/span>Home<span style=\"color: #333333;\">&gt;<\/span> <span style=\"color: #333333;\">{<\/span>\n        HomeScreen<span style=\"color: #333333;\">(<\/span>onNavigateToProfile <span style=\"color: #333333;\">=<\/span> <span style=\"color: #333333;\">{<\/span> id <span style=\"color: #333333;\">-&gt;<\/span>\n            navController<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">navigate<\/span><span style=\"color: #333333;\">(<\/span>Profile<span style=\"color: #333333;\">(<\/span>id<span style=\"color: #333333;\">))<\/span>\n        <span style=\"color: #333333;\">})<\/span>\n     <span style=\"color: #333333;\">}<\/span>\n     composable<span style=\"color: #333333;\">&lt;<\/span>Profile<span style=\"color: #333333;\">&gt;<\/span> <span style=\"color: #333333;\">{<\/span> backStackEntry <span style=\"color: #333333;\">-&gt;<\/span>\n         val <span style=\"color: #997700; font-weight: bold;\">profile:<\/span> Profile <span style=\"color: #333333;\">=<\/span> backStackEntry<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">toRoute<\/span><span style=\"color: #333333;\">()<\/span>\n         ProfileScreen<span style=\"color: #333333;\">(<\/span>profile<span style=\"color: #333333;\">)<\/span>\n     <span style=\"color: #333333;\">}<\/span>\n<span style=\"color: #333333;\">}<\/span><\/span>\n<\/pre>\n<\/div>\n<p>For more information, see <a href=\"https:\/\/medium.com\/androiddevelopers\/navigation-compose-meet-type-safety-e081fb3cf2f8\" target=\"_blank\" rel=\"noopener\">this blog post<\/a>.<\/p>\n<h4 style=\"text-align: left;\"><span style=\"font-size: large;\">CameraX Compose<\/span><\/h4>\n<p>We are releasing a new Compose-specific CameraX artifact called <span style=\"color: #0d904f; font-family: courier;\">camera-viewfinder-compose<\/span>. In this <a href=\"https:\/\/developer.android.com\/jetpack\/androidx\/releases\/camera\" target=\"_blank\" rel=\"noopener\">first alpha release<\/a>, you can use the new <span style=\"color: #0d904f; font-family: courier;\">Viewfinder<\/span> composable to display a camera preview on your screen that always shows the correct aspect ratio and rotation, whether you resize your window, unfold your device, or change the display or orientation. It also correctly handles camera and surface lifecycles, something that can be difficult when dealing with cameras. It also enables complex interactions in the camera coordinate system, making it easy for you to implement gestures such as tap-to-focus or pinch-to-zoom.<\/p>\n<p>You can use the <span style=\"color: #0d904f; font-family: courier;\">Viewfinder<\/span> composable even when you aren\u2019t using any of the other CameraX libraries, and link it directly to your Camera2 code.<\/p>\n<p>We are actively working on improving the APIs and are looking forward to your feedback! Check out the <a href=\"https:\/\/issuetracker.google.com\/issues?q=status:open%20componentid:618491&amp;s=created_time:desc\" target=\"_blank\" rel=\"noopener\">known issues<\/a>, and <a href=\"https:\/\/issuetracker.google.com\/issues\/new?component=618491&amp;template=1257717\" target=\"_blank\" rel=\"noopener\">raise bugs or feature requests<\/a> to help us create the best possible camera experience in Compose.<\/p>\n<h3>Get started<\/h3>\n<p>We\u2019re grateful for all of the bug reports and feature requests submitted to our <a href=\"http:\/\/goo.gle\/compose-feedback\" target=\"_blank\" rel=\"noopener\">issue tracker<\/a> that led to these changes \u2014 they help us to improve Compose and build the APIs you need. Please continue providing your feedback, and help us make Compose better for you.<\/p>\n<p>Wondering what\u2019s next? Check out our <a href=\"http:\/\/goo.gle\/compose-roadmap\">roadmap<\/a> to see the features we\u2019re currently thinking about and working on. We can\u2019t wait to see what you build.<\/p>\n<p>Happy composing!<\/p>\n<\/div>\n<p>[ad_2]<br \/>\n<br \/><a href=\"http:\/\/android-developers.googleblog.com\/2024\/05\/whats-new-in-jetpack-compose-at-io-24.html\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Posted by Ben Trengrove \u2013 Developer Relations Engineer, and Nick Butcher \u2013 Product Manager for Jetpack Compose At Google I\/O 2024, we announced the<\/p>\n","protected":false},"author":1,"featured_media":231612,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[146],"tags":[],"_links":{"self":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts\/231611"}],"collection":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/comments?post=231611"}],"version-history":[{"count":0,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts\/231611\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/media\/231612"}],"wp:attachment":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/media?parent=231611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/categories?post=231611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/tags?post=231611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}