[HTML payload içeriği buraya]
34.2 C
Jakarta
Wednesday, May 13, 2026

Jetpack WindowManager 1.5 is steady


Jetpack WindowManager 1.5 is stable

We’re excited to announce that Jetpack WindowManager 1.5.0 is now steady!

This launch builds on the robust basis of adaptability in WindowManager, making it even simpler to create polished, adaptive UIs that look nice on all display sizes. Because the Android ecosystem continues to develop, customers are partaking with apps on a greater variety of gadgets than ever earlier than: from telephones and foldables to tablets, linked shows, Chromebooks, and even automotive shows in parked mode.

WindowManager 1.5 focuses on offering higher instruments for this numerous machine setting.

This steady launch introduces new breakpoints for very giant screens, enhances the exercise embedding API, and offers extra flexibility for calculating window metrics.

New window dimension courses: Massive and Additional-large

The most important replace in 1.5 is the addition of two new width window dimension courses: Massive and Additional-large.

Window dimension courses are our official, opinionated set of viewport breakpoints that provide help to design and develop adaptive layouts. With 1.5, we’re extending this steerage for screens that transcend typical tablets.

Listed here are the brand new width breakpoints:

Jetpack WindowManager 1.5 is stable

The completely different window dimension courses primarily based on show width. 

Why are these vital?

Beginning with Android 16 QPR1 Beta 2, Android helps linked shows, enabling customers to connect an exterior show to their machine and remodel it right into a desktop-like software with a big display.

Telephone linked to an exterior show, with a desktop session on the exterior show. 

With this new characteristic out there, opinionated steerage to incorporate greater shows is essential. 

On these very giant surfaces, merely scaling up a pill’s Expanded
format is not all the time the most effective consumer expertise. An electronic mail shopper, for instance, may comfortably present two panes (a mailbox and a message) within the Expanded window dimension class. However on an
Additional-large desktop monitor, the e-mail shopper might elegantly show three and even 4 panes—maybe a mailbox, a message record, the total message content material, and a calendar/duties panel, all of sudden.

By offering official breakpoints for very giant show sizes, WindowManager 1.5 offers you a transparent sign to
introduce layouts particularly designed for a productive, information-dense desktop expertise.

The window dimension courses may be calculated utilizing computeWindowSizeClass(), which is an androidx.window.core.format library extension perform that extends the Set<WindowSizeClass> sort. 

To incorporate the brand new window dimension courses in your venture, merely name the perform from the WindowSizeClass.BREAKPOINTS_V2 set as an alternative of WindowSizeClass.BREAKPOINTS_V1:

val currentWindowMetrics =

    WindowMetricsCalculator.getOrCreate()

    .computeCurrentWindowMetrics(LocalContext.present)

val sizeClass = WindowSizeClass.BREAKPOINTS_V2

    .computeWindowSizeClass(currentWindowMetrics)


Then apply the right format while you’re positive your app has a minimum of that a lot house:

if(sizeClass.isWidthAtLeastBreakpoint(

    WindowSizeClass.WIDTH_DP_LARGE_LOWER_BOUND)){

    

// window is a minimum of 1200 dp large

}

The Compose Materials 3 Adaptive library helps you create adaptive UIs that adapt themselves routinely in keeping with the present window configurations like window dimension courses or machine postures. 

The excellent news is that the library is already updated with the brand new breakpoints! Ranging from model
1.2
(now in Launch Candidate stage), the default pane scaffold directive features assist Massive and Additional-large window width dimension courses.

You solely have to opt-in by declaring in your Gradle construct file that you just need to use the brand new breakpoints:

currentWindowAdaptiveInfo(

    supportLargeAndXLargeWidth = true)

  • Exercise embedding — auto-save and restore: WindowManager can now routinely save and restore the state of your exercise embedding splits. This helps protect the consumer’s format throughout course of recreation, resulting in a extra steady and constant expertise. Builders don’t have to avoid wasting and restore the state manually anymore, however they will merely opt-in auto by setting the EmbeddingConfiguration#isAutoSaveEmbeddingState property.

To begin utilizing the brand new Massive and Additional-large dimension courses and different 1.5 options in your Android tasks, replace your app dependencies in construct.gradle.kts to the newest steady model:

WindowManager 1.5 is one other step ahead for creating absolutely adaptive apps that run throughout Android kind elements. Try the official launch notes for a whole record of adjustments and bug fixes.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles