Coordinatorlayout
最近更新时间 | 稳定版 | 候选版本 | Beta 版 | Alpha 版 |
---|---|---|---|---|
2022 年 1 月 12 日 | 1.2.0 | - | - | - |
声明依赖项
如需添加 CoordinatorLayout 的依赖项,您必须将 Google Maven 代码库添加到项目中。如需了解详情,请参阅 Google 的 Maven 代码库。
在应用或模块的 build.gradle
文件中添加所需工件的依赖项:
Groovy
dependencies { implementation "androidx.coordinatorlayout:coordinatorlayout:1.2.0" }
Kotlin
dependencies { implementation("androidx.coordinatorlayout:coordinatorlayout:1.2.0") }
如需详细了解依赖项,请参阅添加 build 依赖项。
反馈
您的反馈将帮助我们改进 Jetpack。如果您发现了新问题,或对此库的改进有自己的见解,请告诉我们。创建新问题前,请先查看此库中的现有问题。您可以点击星标按钮,为现有问题投票。
如需了解详情,请参阅问题跟踪器文档。
1.2 版
版本 1.2.0
2022 年 1 月 12 日
发布了 androidx.coordinatorlayout:coordinatorlayout:1.2.0
。版本 1.2.0 中包含这些提交内容。
自 1.1.0 以来的重要变更
- 仅在 CoordinatorLayout 规则中保留运行时可见注解 (9ec7cb)
版本 1.2.0-rc01
2021 年 12 月 15 日
发布了 androidx.coordinatorlayout:coordinatorlayout:1.2.0-rc01
。版本 1.2.0-rc01 中包含这些提交内容。
版本 1.2.0-beta01
2021 年 11 月 17 日
发布了 androidx.coordinatorlayout:coordinatorlayout:1.2.0-beta01
。版本 1.2.0-beta01 中包含这些提交内容。
API 变更
- Beta 版的 API 已最终确定。
版本 1.2.0-alpha01
2021 年 11 月 3 日
发布了 androidx.coordinatorlayout:coordinatorlayout:1.2.0-alpha01
。版本 1.2.0-alpha01 中包含这些提交内容。
bug 修复
- 仅在 CoordinatorLayout 规则中保留运行时可见注解 (9ec7cb)
版本 1.1.0
版本 1.1.0
2019 年 12 月 4 日
发布了 androidx.coordinatorlayout:coordinatorlayout:1.1.0
。版本 1.1.0 中包含这些提交内容。
自 1.0.0 以来的重要变更
- aosp/737190:CoordinatorLayout 现在实现了
NestedScrollingParent3
,并且CoordinatorLayout.Behavior
实现了onNestedScroll
的新重载,以使Behaviors
能够向嵌套滚动子级报告其在每一遍dispatchNestedScroll()
/onNestedScroll()
操作期间所消耗的滚动距离。弃用了之前存在的onNestedScroll(CoordinatorLayout, V, View, int, int, int, int, int)
,转为使用新的onNestedScroll(CoordinatorLayout, V, View, int, int, int, int, int, int[])
,并且应相应地更新Behavior
实现。如果开发者代码当前替换CoordinatorLayout#onNestedScroll(View, int, int, int, int, int)
,很可能就不会再调用该方法,因此应该改为替换CoordinatorLayout#onNestedScroll(View, int, int, int, int, int, int[])
。 - 向无障碍服务公开了 CoordinatorLayout (aosp/1056175)
- 已弃用
CoordinatorLayout.DefaultBehavior
注释。请改用CoordinatorLayout.AttachedBehavior
接口。
版本 1.1.0-rc01
2019 年 10 月 23 日
发布了 androidx.coordinatorlayout:coordinatorlayout:1.1.0-rc01
。版本 1.1.0-rc01 中包含这些提交内容。
新功能
- 向无障碍服务公开了 CoordinatorLayout (aosp/1056175)
版本 1.1.0-beta01
2019 年 6 月 5 日
发布了 androidx.coordinatorlayout:coordinatorlayout:1.1.0-beta01
。点击此处可查看此版本中包含的提交内容。
bug 修复
- 停止使用已弃用的测试类 (aosp/853955)
版本 1.1.0-alpha01
2018 年 12 月 3 日
API 变更
aosp/737190:CoordinatorLayout 现在实现了
NestedScrollingParent3
,并且CoordinatorLayout.Behavior
实现了onNestedScroll
的新重载,以使Behaviors
能够向嵌套滚动子级报告其在每一遍dispatchNestedScroll()
/onNestedScroll()
操作期间所消耗的滚动距离。弃用了先前已有的onNestedScroll(CoordinatorLayout, V, View, int, int, int, int, int)
,取而代之的是新的onNestedScroll(CoordinatorLayout, V, View, int, int, int, int, int, int[])
,并且应相应地更新Behavior
实现。如果开发者代码当前替换
CoordinatorLayout#onNestedScroll(View, int, int, int, int, int)
,则很可能不会再调用该方法,因此应该改为替换CoordinatorLayout#onNestedScroll(View, int, int, int, int, int, int[])
。