当前位置:网站首页>Latest development of jetpack compose
Latest development of jetpack compose
2022-06-24 23:25:00 【Sharp surge】
Link to the original text https://android-developers.googleblog.com/2022/05/whats-new-in-jetpack-compose.html
Jetpack Compose 1.0 It's been almost a year since it was released , During this period, we see that the community is its passion , For example, appreciate Kotlin The simplicity of grammar 、 send UI Develop declarative methods that become easier and easier .
In the community Compose
We have seen many companies begin to use on a large scale Compose, for example Compose On Play Store Team work closely , They started trying very early Compose , It's not only more interesting to understand it , And it's also very helpful to improve the productivity of their developers .
Play Store The team :“ All new Play Store functions are built on this framework ,Compose Help unlock faster and smoother releases for applications .”
Twitter The team has been using Jetpack Compose.
Twitter The team :“Compose Let's make it easier to define our own components , And make their API The contract is clearer 、 Flexible and intuitive .”
Airbnb The team also adopted Compose.
Airbnb The team :“ Jetpack Compose Is a key part of our technology strategy . The increase in productivity is huge .”
We are pleased to see the use of... In these large and complex production environments Compose, Compose Don't let them in UI Experience more fun in development , And it improves the advantages of related projects !
「 These are just a few examples , because Play Top of the store 1000 There are 100 Multiple in use Compose」.
These work closely and always listen Android Community feedback is at the heart of our development process , It is also the key to advancing our future road map .
We are now focused on supporting more advanced use cases , Include :
new API And functional improvements
New tools
Easier to use Compose Build
We know Compose Fundamentally changed UI How to build , To help developers make the necessary thinking changes , More guidance on our advanced topics will be released 、 Speech and code lab , And more in-depth videos , To help developers write better applications .
Compose 1.2 The beta
today , We released Compose 1.2 One of the first beta edition , It contains many features and improvements .
Text improvements
Font fill : We use customizable parameters includeFontPadding Solved one of the most voted errors in the problem tracker , It is recommended that developers set this value to false,「 Because this will make the text in the layout more accurately aligned 」.
Our plan is to set it to the default value in future versions , If the value is set to false Causing problems with the application , Please write in the above issue Tell us . In addition, when includeFontPadding Set to false when , Can be set by lineHeightStyle Parameter to adjust the line height of composable text , The combination can be like this

Text(
text = myText,
style = TextStyle(
lineHeight = 2.5.em,
platformStyle = PlatformTextStyle(
includeFontPadding = false
),
lineHeightStyle = LineHeightStyle(
alignment = Alignment.Center,
trim = Trim.None
)
)
)
Downloadable fonts : Compose 1.2 still Compose Downloadable fonts are introduced in , Developers can use Compose The new API To access asynchronously Google typeface , You can even define Alternate Fonts , Without any complicated setup .
Use downloadable fonts , Developers can keep small APK Size and improve health , Because multiple applications can pass through provider Share the same font . Text magnifier : Android Text provides a magnifying glass control , You can more easily select text ,Compose Text magnifiers are now also supported .

When you drag a selection, a magnifying glass appears , To help you see what's under your finger ,Compose 1.1.0 Use a magnifying glass for selection in the text field , Now? Compose 1.2.0 Supports magnifying glass and... In text fields SelectionContainer , The magnifying glass has also been enhanced to match Views in Android The exact behavior of the magnifying glass .
Layout features and improvements
Lazy layout
With the release of lazy layout , API LazyVerticalGrid and LazyHorizontalGrid Has graduated from the experimental stage , A new experimental API Be added , be called LazyLayout, It allows developers to implement their own custom lazy layouts .
And CoordinatorLayout Interaction
When embedding composable scrolling in the view system CoordinatorLayout when , Developers can now ensure that their scrolling behavior is interoperable , This makes it easier to set up the collapsible toolbar . Now developers can use rememberNestedScrollInteropConnection Pass the result of calling the new experimental method to nestedScroll Modifier to choose to join this behavior
Window illustration
Accompanist in insets The library has now been upgraded to... Using this class Compose Foundation library , Use WindowInsets object , Relevant contents can be found in our about Compose With the existing UI Read more about it in the integrated documentation .
Window size class
To make it easier to design 、 Develop and test resizable layouts , We released the window size class - A series of configurable viewport breakpoints.material3-window-size-class As Material 3 Part of the library set , They are now in the new library as alpha The form provides , Developers can read more about size classes in the documentation that supports different screen sizes , And look at Crane Example implementation in .
Focus on performance
To help developers understand and improve the performance of applications , We are very concerned about new performance tools and guidelines , With performance, It's easier for developers to understand App Maybe the cause and location of Caton .
from Android Studio Dolphin Start , Developers can now use Layout Inspector Check recomposition The frequency of , a large number of recomposition It can help developers point to the direction of optimization .
Besides ,Android Studio Electric Eel Now include a recomposition Fluorescent pen , This is a to see which composables Item when recomposition Visual aids .

Compose Fundamentally changed the writing of UI The way , Therefore, developers can adopt some new ways to ensure the performance of applications .
Newly released compose-performance Suggest how to write and configure Compose Applications for optimal performance .
stay I/O There are also... In the speech Jetpack Compose Common performance problems in ,Compose The team described common performance errors and how to fix them .
Performance is an area that needs constant attention , We are working to improve extension tools and guidance , At the same time, we are very grateful for your feedback on what we have done so far , If there is any problem, you can put forward your error in the problem tracking or in KotlinLang Slack Group questions .
New tools
In addition to the above improvements , Development tools are also being updated , Help you use more effectively Compose.Android Studio Dolphin, Now it is Beta edition , by Compose The development of has brought exciting features . In addition to the recombination count , The new tool also includes animation coordination , So you can see all the details of the animation at once , as well as MultiPreview notes , Help you build for multiple screen sizes . To enable you to iterate faster Android Studio Electric Eel( stay Canary in ) brought LiveEdit function .
by Wear OS To write Compose
We are glad to see Compose for Wear OS Get into Beta edition ! Follow with any other Jetpack Library the same principle ,Beta It means that its function is complete and API Stable , Developers can now start building Wear Application .
Improvement guide
This time we added and modified a lot about Compose Guide to :
stay Compose Medium State New seminars and improved codelab
About Compose Of the basic layout in New workshops and improved codelab
New performance documentation
Updated the custom input document
I/O Discuss Jetpack Compose Common performance pitfalls and Compose Inert layout in
For those unfamiliar with programming , Now you can use with Compose Of Android basic course
Last
We hope you can discover these new features like us , If you haven't started yet , It's time to learn Jetpack Compose 了 .
from :Jetpack Compose Latest progress ! No, let's take a look ?
边栏推荐
- Laravel authentication module auth
- EMI的主要原因-工模电流
- Financial management [3]
- 376. Tâches mécaniques
- Gocolly manual
- Theoretical analysis of countermeasure training: adaptive step size fast countermeasure training
- RT-thread使用rt-kprintf
- [JS] - [string - application] - learning notes
- R语言使用MatchIt包进行倾向性匹配分析、使用match.data函数构建匹配后的样本集合、通过双样本t检验分析(双独立样本t检验)来判断倾向性评分匹配后样本中的所有协变量的平衡情况
- Financial management [5]
猜你喜欢

Record the range of data that MySQL update will lock

Ningde times will increase RMB 45billion: Hillhouse subscribes RMB 3billion and Zeng Yuqun still controls 23% of the equity

02_ Springboot starter case

【UVM入门 ===> Episode_8 】~ Sequence 和 Sequencer、Sequence 层次化
![[JS] - [stack, team - application] - learning notes](/img/5b/b90ed8d3eb4fc0ab41c6ea8d092d0f.png)
[JS] - [stack, team - application] - learning notes

Dig deep into MySQL - resolve the non clustered index of MyISAM storage engine

Case analysis: using "measurement" to improve enterprise R & D efficiency | ones talk
Mycms we media CMS V3.0, resource push optimization, new free template

Epics record reference 4 -- fields for all input records and fields for all output records

02_SpingBoot 入门案例
随机推荐
Attention, postgraduate candidates! They are the easiest scams to get caught during the preparation period?!
[JS] - [stack, team - application] - learning notes
【js】-【数组应用】-学习笔记
冒泡排序
Écoutez le fichier markdown et mettez à jour Hot next. Page JS
SQL -convert function
376. 機器任務
Installation and deployment of ganglia
OpenSSL SSL_ read: Connection was reset, errno 10054
golang map clear
How should we measure agile R & D projects?
【js】-【數組、棧、隊列、鏈錶基礎】-筆記
03_SpingBoot 核心配置文件
376. machine tasks
[JS] - [linked list - application] - learning notes
No main manifest attribute in jar
[JS] - [array, stack, queue, linked list basics] - Notes
Notes for laravel model
OpenSSL SSL_read: Connection was reset, errno 10054
laravel 消息队列