Coordinatorlayout
最近更新时间 | 当前稳定版 | 下一候选版本 | Beta 版 | Alpha 版 |
---|---|---|---|---|
2019 年 12 月 4 日 | 1.1.0 | - | - | - |
声明依赖项
如需添加 CoordinatorLayout 的依赖项,您必须将 Google Maven 代码库添加到项目中。如需了解详情,请参阅 Google 的 Maven 代码库。
在应用或模块的 build.gradle
文件中添加所需工件的依赖项:
dependencies { implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0" }
如需详细了解依赖项,请参阅添加构建依赖项。
反馈
您的反馈将帮助我们改进 Jetpack。如果您发现了新问题,或对库的改进有某些建议,请告诉我们。创建新问题前,请先查看此库中的现有问题。您可以点击星标按钮,为现有问题投票。
如需了解详情,请参阅问题跟踪器文档。
版本 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
。点击此处可查看此版本中包含的提交内容。
问题修复
- 停止使用已弃用的测试类 (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[])
。