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") }
如要進一步瞭解依附元件,請參閱 新增建構依附元件 一文。
意見回饋
您的意見可協助我們改善 Jetpack。如果您發現新問題,或是對這個程式庫有改進建議,請告訴我們。請先查看這個程式庫的 現有問題,再建立新問題。如果要投票給現有問題,請按一下星號按鈕。
詳情請參閱 Issue Tracker 說明文件。
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 變更
- API 已推出 Beta 版。
1.2.0-alpha01 版本
2021 年 11 月 3 日
已釋出 androidx.coordinatorlayout:coordinatorlayout:1.2.0-alpha01
。1.2.0-alpha01 版包含這些修訂版本。
修正錯誤
- 只保留 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
。您可以前往 這裡 查看這個版本包含的修訂版本。
修正錯誤
- 遷移已被淘汰的測試類別 (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[])
。