远程撰写
| 最近更新时间 | 稳定版 | 候选版 | Beta 版 | Alpha 版 |
|---|---|---|---|---|
| 2026 年 4 月 8 日 | - | - | - | 1.0.0-alpha08 |
声明依赖项
如需添加 compose-remote 的依赖项,您必须将 Google Maven 制品库添加到项目中。如需了解详情,请参阅 Google 的 Maven 代码库。
在应用或模块的 build.gradle 文件中添加所需工件的依赖项:
Groovy
dependencies { implementation "androidx.compose.remote:remote-core:1.0.0-alpha08" // Use to create Remote Compose documents implementation "androidx.compose.remote:remote-creation:1.0.0-alpha08" implementation "androidx.compose.remote:remote-creation-core:1.0.0-alpha08" implementation "androidx.compose.remote:remote-creation-android:1.0.0-alpha08" implementation "androidx.compose.remote:remote-creation-jvm:1.0.0-alpha08" implementation "androidx.compose.remote:remote-creation-compose:1.0.0-alpha08" // Use to render a Remote Compose document implementation "androidx.compose.remote:remote-player-core:1.0.0-alpha08" implementation "androidx.compose.remote:remote-player-view:1.0.0-alpha08" implementation "androidx.compose.remote:remote-tooling-preview:1.0.0-alpha08" }
Kotlin
dependencies { implementation("androidx.compose.remote:remote-core:1.0.0-alpha08") // Use to create Remote Compose documents implementation("androidx.compose.remote:remote-creation:1.0.0-alpha08") implementation("androidx.compose.remote:remote-creation-core:1.0.0-alpha08") implementation("androidx.compose.remote:remote-creation-android:1.0.0-alpha08") implementation("androidx.compose.remote:remote-creation-jvm:1.0.0-alpha08") implementation("androidx.compose.remote:remote-creation-compose:1.0.0-alpha08") // Use to render a Remote Compose document implementation("androidx.compose.remote:remote-player-core:1.0.0-alpha08") implementation("androidx.compose.remote:remote-player-view:1.0.0-alpha08") implementation("androidx.compose.remote:remote-tooling-preview:1.0.0-alpha08") }
如需详细了解依赖项,请参阅添加 build 依赖项。
反馈
您的反馈将帮助我们改进 Jetpack。如果您发现了新问题,或对此库有任何改进建议,请告诉我们。创建新问题前,请先查看此库中的现有问题。您可以点击星标按钮,为现有问题投票。
如需了解详情,请参阅问题跟踪器文档。
1.0 版
版本 1.0.0-alpha08
2026 年 4 月 8 日
发布了 androidx.compose.remote:remote-*:1.0.0-alpha08。版本 1.0.0-alpha08 中包含这些提交内容。
新功能
- 将
CoreText、TextStyle、TextTransform和ColorTheme操作提升为基准 AndroidX 和 widget 配置文件(I69671、b/494482597)CoreText提供了更丰富的文本呈现功能,包括自适应文本大小调整,以及对换行和溢出行为等文本布局功能的改进控制。TextStyle允许在文档中捕获一次通用文本样式属性,并由多个文本运行引用。TextTransform可实现文本转换,例如将文本转换为大写。
- 当布局方向为 RTL 且未使用绝对水平排列时,反向渲染水平布局中的项。(I2d38e)
API 变更
- 首选
toRemoteString(DecimalFormat)作为开发者 API。(Ia4925、b/493924433) - 移除了修饰符
clip(shape, size)。应改用修饰符clip(shape)。(I76301)
bug 修复
- 更新
TextLookup以跟踪数组元素更改。这样可确保在表达式在数组中查找的元素发生更改时,系统会重新评估表达式 (I162c7)
版本 1.0.0-alpha07
2026年 3 月 25 日
发布了 androidx.compose.remote:remote-*:1.0.0-alpha07。版本 1.0.0-alpha07 中包含这些提交内容。
新功能
API 变更
- 将
RemoteSpacer作为公共 API 进行公开 (I1a540) - 将
RemoteBrushapplyTo和字样 API 公开(I87ce9、b/493249631) - 从
drawTextOnCircle中省略了对齐和放置参数(I7fd16、b/446824085) - 公开了语义修饰符函数 (Ice73b)
- 公开了
RemoteImageVector和painterRemoteVector(If8f38、b/446824085) - 将
RemoteTimeDefaults作为remote-creation-compose中的公共 API 进行公开(Iddc74、b/446824085) - 将
RemoteArrangement.spacedBy方法设为公开 (I36e86) - 公开了更多
RemoteDrawScopeAPI (I1dde7) - 在 API 中公开
RemotePainter类型 (I1ec8e) - 公开了
RemoteBrushAPI (I4b074) - 为
RemoteCanvas添加了最少的公共 API(I00853、b/446824085) - 公开 RC 语义修饰符(I8b175、b/446824085)
- 公开
RemoteFloat.asRemoteDp()(I28b36、b/446824085) - 公开
RemoteFloat操作(I85fb5、b/446824085) RemoteArrangement.CenterHorizontally已移除,取而代之的是RemoteArrangement.Center。(I2f907、b/471212869、b/471153933)- 更改
RemoteBox对齐方式以接受单个RemoteAlignment。(I0bfbf、b/471212869)
版本 1.0.0-alpha06
2026 年 3 月 11 日
发布了 androidx.compose.remote:remote-*:1.0.0-alpha06。版本 1.0.0-alpha06 中包含这些提交内容。
新功能
- 为
TextStyle添加了新的实验性操作。TextStyle可让常用排版样式只需写入文档一次,即可供多个文本运行 (bfc6487) 重复使用
API 变更
- 公开
RemoteTextStyle合并(I971ce、b/446824085) - 将
RemotePainter公开为公共 API(I252c1、b/446824085) - 公开了
Border/Clip修饰符和RemoteShape。(Id26dd、b/446824085) - 在
remote-creation-compose中公开了RemoteColorAPI(I4ab00、b/446824085) - 公开了
RemoteTextAPI (I6b019) - 公开了
RemoteImageAPI (Ided31) - 公开了
RemoteBoolean、RemoteString和RemoteFloatAPI (Id9ee6) - 来自
WidthIn注解的远程可组合项 (I80784)
bug 修复
- 将库移至使用 Java 11 目标平台。这意味着生成的字节码将是 Java 11(类文件版本 55),可能需要进行 desugaring 才能使用该库(If4c2a、b/457821470)
版本 1.0.0-alpha05
2026 年 2 月 25 日
发布了 androidx.compose.remote:remote-*:1.0.0-alpha05。版本 1.0.0-alpha05 中包含这些提交内容。
新功能
- 推出了
fillParentMaxWidth和fillParentMaxHeight。(4c6d77c)
API 变更
- 公开了常见的远程可组合项和修饰符类型 (Id1d40)
- 公开了
RemoteState的类型(I22429、b/465453482)
bug 修复
版本 1.0.0-alpha04
2026 年 2 月 11 日
发布了 androidx.compose.remote:remote-*:1.0.0-alpha04。版本 1.0.0-alpha04 中包含这些提交内容。
新功能
- 默认使用
RemoteApplier启用,这样可以防止在创建远程界面时使用非远程可组合函数。您可以通过更改RemoteComposeCreationComposeFlags中的isRemoteApplierEnabled来停用此功能。(67a405f) - 为位图字体添加字形间距 (0852657)
- 在
RemoteCanvas中旋转(使用透视)(9a292b3) - 添加了
RemoteSpacer(12beb72) - 避免
java.time依赖项,从而将创建库的minSdk降至 23 (59e30d0) FlowLayout(7efef02)
bug 修复
- 修复了非全局
ColorExpression和计算出的字符串的评估。(c08d0bd)
外部贡献
androidx.compose.ui.graphics.NativePaint类型别名已废弃,请直接使用android.graphics.Paint(I6303c、b/477394763)- 将
Paint.asFrameworkPaint()替换为Paint.nativePaint扩展,以避免通过typealias将平台类型暴露到commonMainsourceset 中(I6303c、b/477394763)
版本 1.0.0-alpha03
2026 年 1 月 28 日
发布了 androidx.compose.remote:remote-*:1.0.0-alpha03。版本 1.0.0-alpha03 中包含这些提交内容。
新功能
API 变更
- 迁移了
RemoteColor和RemoteBitmap的 API,以使用 Compose 类型,而不是直接公开 Android 类型 a9bfbb8 - 引入
RemoteDensity类型,以确定是在播放器上评估密度(当为远程设备生成文档时),还是内联表达式(以优化同一设备上的文档大小)54352bb RemoteState constantValueOrNull重命名(I6ad5c、b/467050397)
版本 1.0.0-alpha02
2026 年 1 月 14 日
发布了 androidx.compose.remote:remote-*:1.0.0-alpha02。版本 1.0.0-alpha02 中包含这些提交内容。
新功能
- 为 CoreText 添加了最小/最大字号。I7bd3c
API 变更
- 为 Glance Wear 基础架构公开了最少的公共 API。(I7b4b9、b/467532762)
- 从
captureSingleRemoteDocument返回CapturedDocument(I5a283、b/467532762)
bug 修复
- 修复了重新布局后的滚动位置问题,并添加了对边缘效果的支持 (6d4551)
版本 1.0.0-alpha01
2025 年 12 月 17 日
发布了 androidx.compose.remote:remote-*:1.0.0-alpha01。版本 1.0.0-alpha01 中包含这些提交内容。
- Remote Compose 是一个用于为远程 surface 创建界面的框架。