What’s new in the Jetpack Compose April ’25 release

Today, as part of the Compose April ‘25 Bill of Materials, we’re releasing version 1.8 of Jetpack Compose, Android's modern, native UI toolkit, used by many developers. This release contains new features like autofill, various text improvements, visibility tracking, and new ways to animate a composable's size and location. It also stabilizes many experimental APIs and fixes a number of bugs. To use today’s release, upgrade your Compose BOM version to 2025.04.01 : implementation(platform("androidx.compose:compose-bom:2025.04.01")) Note: If you are not using the Bill of Materials, make sure to upgrade Compose Foundation and Compose UI at the same time. Otherwise, autofill will not work correctly. Autofill Autofill is a service that simplifies data entry. It enables users to fill out forms, login screens, and checkout processes without manually typing in every detail. Now, you can integrate this functionality into your Compose applications. Setting up Autofill in your Compose text fields is straightforward: 1. Set the contentType Semantics: Use Modifier.semantics and set the appropriate contentType for your text fields. For example: TextField( state = rememberTextFieldState(), modifier = Modifier.semantics { contentType = ContentType.Username } ) 2. Handle saving credentials (for new or updated information): a. Implicitly through navigation: If a user navigates away from the page, commit will be called automatically - no code needed! b. Explicitly through a button: To trigger saving credentials when the user submits a form (by tapping a button, for instance), retrieve the local AutofillManager and call commit(). For full details on how to implement autofill in your application, see the Autofill in Compose documentation. Text When placing text inside a container, you can now use the autoSize parameter in BasicText to let the text size automatically adapt to the container size: Box { BasicText( text = "Hello World", maxLines = 1, autoSize = TextAutoSize.StepBased() ) }

Comments

Popular posts from this blog

Announcing Android support of digital credentials

Zoho Achieves 6x Faster Logins with Passkey and Credential Manager Integration