路线图
https://developer.android.google.cn/jetpack/androidx/compose-roadmap
Jetpack Compose
https://developer.android.google.cn/jetpack/compose
Compose for Wear OS 1.0 版
https://android-developers.googleblog.com/2022/07/compose-for-wear-os-10-stable.html
Compose 1.2 版本更新示例
https://github.com/android/compose-samples
Compose 1.2 版本 Codelab
https://developer.android.google.cn/courses/pathways/compose
Accompanist 开发库
https://github.com/google/accompanist
MDC-Compose 主题适配器
https://material-components.github.io/material-components-android-compose-theme-adapter/
注意: 将 Compose 编译器内容库更新到 1.2 版本需要使用 Kotlin 1.7.0。从该版本开始,编译器版本将与其他 Compose 开发库的版本解耦。您可以阅读文章了解这样做的原因:
文章: 关于 Jetpack Compose 内容库独立版本控制
https://android-developers.googleblog.com/2022/06/independent-versioning-of-Jetpack-Compose-libraries.html
全新稳定功能和 API
我们已添加多个稳定功能和 API,主要包括:
LazyHorizontalGrid
http://link.gevents.cn/FX2MuW
LazyVerticalGrid
http://link.gevents.cn/w4bR5k
WindowInsets
https://developer.android.google.cn/reference/kotlin/androidx/compose/foundation/layout/WindowInsets
systemBarsPadding
http://link.gevents.cn/72AGuS
windowInsetsTopHeight
http://link.gevents.cn/hgmByj
Accompanist insets 开发库
https://google.github.io/accompanist/insets/
Modifier.nestedScroll
http://link.gevents.cn/TZGjpN
Modifier.nestedScroll 示例
http://link.gevents.cn/KCr8Tw
手势文档
https://developer.android.google.cn/jetpack/compose/gestures#nested-scrolling-interop
缓和曲线
https://developer.android.google.cn/reference/kotlin/androidx/compose/animation/core/package-summary#Ease()
动画指南
https://developer.android.google.cn/jetpack/compose/animation#easing
Modifier.pointerHoverIcon
http://link.gevents.cn/W2u9kz
PointerEventType.Scroll
https://developer.android.google.cn/reference/kotlin/androidx/compose/ui/input/pointer/PointerEventType.Companion#Scroll()
PointerEvent.scrollDelta
https://developer.android.google.cn/reference/kotlin/androidx/compose/ui/input/pointer/PointerInputChange#scrollDelta()
全新实验性 API
使用 LazyLayout 创建您的自定义高效可滚动布局。使用 Modifier.overscroll 向可滚动容器添加自定义的滚动效果。
使用 GoogleFont 下载字体。请阅读官方文档了解详情。
添加了许多文本功能,例如允许自定义 includeFontPadding 和行高 (您可以参考文本文档和相关文章)、Brush API (可参考此文章),以及 pluralStringResource。
改进了测试 API。例如,performKeyInput 操作可在测试中模拟键盘输入。新的 testTagsAsResourceId 语义属性可与 UI Automator 集成。
LazyLayout
http://link.gevents.cn/ZjTCs2
Modifier.overscroll
http://link.gevents.cn/2Mf2xp
GoogleFont
https://developer.android.google.cn/reference/kotlin/androidx/compose/ui/text/googlefonts/GoogleFont
官方文档: 下载字体
https://developer.android.google.cn/jetpack/compose/text#downloadable-fonts
文本文档
https://developer.android.google.cn/jetpack/compose/text#includefontpadding_and_lineheight_apis
文本功能相关文章
https://medium.com/androiddevelopers/fixing-font-padding-in-compose-text-768cd232425b
Brush API
https://developer.android.google.cn/reference/kotlin/androidx/compose/ui/graphics/Brush
Brush API 相关文章
https://medium.com/androiddevelopers/brushing-up-on-compose-text-coloring-84d7d70dd8fa
pluralStringResource
https://developer.android.google.cn/reference/kotlin/androidx/compose/ui/res/package-summary#pluralStringResource(kotlin.Int,kotlin.Int)
performKeyInput
http://link.gevents.cn/RFd8SD
testTagsAsResourceId
http://link.gevents.cn/WTJxJE
@OptIn
https://developer.android.google.cn/reference/kotlin/androidx/annotation/OptIn
分享反馈
https://issuetracker.google.com/issues/new?component=612128
解决的问题
我们修复了社区提出的许多问题,以下几点值得关注:
系统定义的 "Animator 时长缩放"
https://issuetracker.google.com/161675988
禁用滚动
https://issuetracker.google.com/201150093
返回按钮行为
https://issuetracker.google.com/192433071
问题跟踪页
https://issuetracker.google.com/issues/new?component=612128
最新路线图
https://developer.android.google.cn/jetpack/androidx/compose-roadmap
开发者分享
https://developer.android.google.cn/jetpack/compose/adopt#what-developers-are-saying
您可以通过下方二维码或在文章底部私信,向我们提交反馈,分享您喜欢的内容、发现的问题。您的反馈对我们非常重要,感谢您的支持!
推荐阅读
点击屏末 | 阅读原文 | 进一步了解 Jetpack Compose 的更多精彩内容