[HTML payload içeriği buraya]
28.7 C
Jakarta
Saturday, May 16, 2026

What’s New in Jetpack Compose



Posted by Nick Butcher – Product Supervisor

At Google I/O 2025, we introduced a number of options, efficiency, stability, libraries, and instruments updates for Jetpack Compose, our really useful Android UI toolkit. With Compose you possibly can construct wonderful apps that work throughout gadgets. Compose has matured so much because it was first introduced (at Google I/O 2019!) and we’re now seeing 60% of the highest 1,000 apps within the Play Retailer equivalent to MAX and Google Drive use and like it.

New Options

Since I/O final 12 months, Compose Invoice of Supplies (BOM) model 2025.05.01 provides new options equivalent to:

    • Autofill help that lets customers mechanically insert beforehand entered private data into textual content fields.
    • Auto-sizing textual content to easily adapt textual content dimension to a dad or mum container dimension.
    • Visibility monitoring for once you want high-performance data on a composable’s place in its root container, display screen, or window.
    • Animate bounds modifier for stunning automated animations of a Composable’s place and dimension inside a LookaheadScope.
    • Accessibility checks in checks that allow you to construct a extra accessible app UI by automated a11y testing.

LookaheadScope {
    Field(
        Modifier
            .animateBounds(this@LookaheadScope)
            .width(if(inRow) 100.dp else 150.dp)
            .background(..)
            .border(..)
    )
}

moving image of animate bounds modifier in action

For extra particulars on these options, learn What’s new within the Jetpack Compose April ’25 launch and take a look at these talks from Google I/O:

Should you’re seeking to check out new Compose performance, the alpha BOM presents new options that we’re engaged on together with:

    • Pausable Composition (see beneath)
    • Updates to LazyLayout prefetch
    • Context Menus
    • New modifiers: onFirstVisible, onVisbilityChanged, contentType
    • New Lint checks for ceaselessly altering values and components that needs to be remembered in composition

Please check out the alpha options and present suggestions to assist form the way forward for Compose.

Materials Expressive

At Google I/O, we unveiled Materials Expressive, Materials Design’s newest evolution that helps you make your merchandise much more participating and simpler to make use of. It is a complete addition of latest parts, kinds, movement and customization choices that make it easier to to construct stunning wealthy UIs. The Material3 library within the newest alpha BOM incorporates lots of the new expressive parts so that you can check out.

moving image of material expressive design example

Be taught extra to begin constructing with Materials Expressive.

Adaptive layouts library

Growing adaptive apps throughout type elements together with telephones, foldables, tablets, desktop, automobiles and Android XR is now simpler with the newest enhancements to the Compose adaptive layouts library. The secure 1.1 launch provides help for predictive again gestures for smoother transitions and pane growth for extra versatile two pane layouts on bigger screens. Moreover, the 1.2 (alpha) launch provides extra flexibility for a way panes are displayed, including methods for reflowing and levitating.

moving image of compose adaptive layouts updates in the Google Play app

Compose Adaptive Layouts Updates within the Google Play app

Be taught extra about constructing adaptive android apps with Compose.

Efficiency

With every launch of Jetpack Compose, we proceed to prioritize efficiency enhancements. The most recent secure launch consists of vital rewrites and enhancements to a number of sub-systems together with semantics, focus and textual content optimizations. Better of all these can be found to you just by upgrading your Compose dependency; no code adjustments required.

bar chart of internal benchmarks for performance run on a Pixel 3a device from January to May 2023 measured by jank rate

Inside benchmark, run on a Pixel 3a

We proceed to work on additional efficiency enhancements, notable adjustments within the newest alpha BOM embrace:

    • Pausable Composition permits compositions to be paused, and their work cut up up over a number of frames.
    • Background textual content prefetch allows textual content format caches to be pre-warmed on a background thread, enabling sooner textual content format.
    • LazyLayout prefetch enhancements enabling lazy layouts to be smarter about how a lot content material to prefetch, benefiting from pausable composition.

Collectively these enhancements get rid of practically all jank in an inside benchmark.

Stability

We have heard from you that upgrading your Compose dependency could be difficult, encountering bugs or behaviour adjustments that forestall you from staying on the newest model. We have invested considerably in bettering the soundness of Compose, working intently with the numerous Google app groups constructing with Compose to detect and forestall points earlier than they even make it to a launch.

Google apps develop in opposition to and launch with snapshot builds of Compose; as such, Compose is examined in opposition to the tons of of hundreds of Google app checks and any Compose points are instantly actioned by our group. We’ve got not too long ago invested in growing the cadence of updating these snapshots and now replace them every day from Compose tip-of-tree, which implies we’re receiving suggestions sooner, and are in a position to resolve points lengthy earlier than they attain a public launch of the library.

Jetpack Compose additionally depends on @Experimental annotations to mark APIs which are topic to alter. We heard your suggestions that some APIs have remained experimental for a very long time, decreasing your confidence within the stability of Compose. We’ve got invested in stabilizing experimental APIs to offer you a extra stable API floor, and lowered the variety of experimental APIs by 32% within the final 12 months.

We’ve got additionally heard that it may be laborious to debug Compose crashes when your individual code doesn’t seem within the stack hint. Within the newest alpha BOM, we’ve added a brand new opt-in characteristic to offer extra diagnostic data. Observe that this doesn’t at present work with minified builds and comes at a efficiency value, so we suggest solely utilizing this characteristic in debug builds.

class App : Software() {
   override enjoyable onCreate() {
        // Allow just for debug taste to keep away from perf influence in launch
        Composer.setDiagnosticStackTraceEnabled(BuildConfig.DEBUG)
   }
}

Libraries

We all know that to construct nice apps, you want Compose integration within the libraries that work together along with your app’s UI.

A core library that powers any Compose app is Navigation. You advised us that you just usually encountered limitations when managing state hoisting and immediately manipulating the again stack with the present Compose Navigation resolution. We went again to the drawing-board and fully reimagined how a navigation library ought to combine with the Compose psychological mannequin. We’re excited to introduce Navigation 3, a brand new artifact designed to empower you with higher management and simplify complicated navigation flows.

We’re additionally investing in Compose help for CameraX and Media3, making it simpler to combine digicam seize and video playback into your UI with Compose idiomatic parts.

@Composable
non-public enjoyable VideoPlayer(
    participant: Participant?, // from media3
    modifier: Modifier = Modifier
) {
    Field(modifier) {
        PlayerSurface(participant) // from media3-ui-compose
        participant?.let {
            // customized play-pause button UI
            val playPauseButtonState = rememberPlayPauseButtonState(it) // from media3-ui-compose
            MyPlayPauseButton(playPauseButtonState, Modifier.align(BottomEnd).padding(16.dp))
        }
    }
}

To be taught extra, see the media3 Compose documentation and the CameraX samples.

Instruments

We proceed to enhance the Android Studio instruments for creating Compose UIs. The newest Narwhal canary consists of:

    • Resizable Previews immediately present you ways your Compose UI adapts to totally different window sizes
    • Preview navigation enhancements utilizing clickable names and parts
    • Studio Labs 🧪: Compose preview technology with Gemini shortly generate a preview
    • Studio Labs 🧪: Rework UI with Gemini change your UI with pure language, immediately from preview.
    • Studio Labs 🧪: Picture attachment in Gemini generate Compose code from pictures.

For extra data learn What’s new in Android improvement instruments.

moving image of resizable preview in Jetpack Compose

Resizable Preview

New Compose Lint checks

The Compose alpha BOM introduces two new annotations and related lint checks that can assist you to write down appropriate and performant Compose code. The @FrequentlyChangingValue annotation and FrequentlyChangedStateReadInComposition lint test warns in conditions the place perform calls or property reads in composition may trigger frequent recompositions. For instance, frequent recompositions may occur when studying scroll place values or animating values. The @RememberInComposition annotation and RememberInCompositionDetector lint test warns in conditions the place constructors, features, and property getters are known as immediately inside composition (e.g. the TextFieldState constructor) with out being remembered.

Glad Composing

We proceed to put money into offering the options, efficiency, stability, libraries and instruments that it’s worthwhile to construct wonderful apps. We worth your enter so please share suggestions on our newest updates or what you’d wish to see subsequent.

Discover this announcement and all Google I/O 2025 updates on io.google beginning Might 22.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles