จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
navigation3
Navigation 3 เป็นไลบรารีการนำทางใหม่ที่ออกแบบมาให้ทำงานร่วมกับ Compose
อัปเดตล่าสุด |
รุ่นที่เสถียร |
รุ่นที่อาจได้รับการเผยแพร่ |
รุ่นเบต้า |
รุ่นอัลฟ่า |
13 สิงหาคม 2025 |
- |
- |
- |
1.0.0-alpha07 |
การประกาศทรัพยากร Dependency
หากต้องการเพิ่มการอ้างอิงใน Navigation3 คุณต้องเพิ่มที่เก็บ Maven ของ Google ลงใน
โปรเจ็กต์ อ่านข้อมูลเพิ่มเติมได้ที่ที่เก็บ Maven ของ Google
เพิ่มการอ้างอิงสำหรับอาร์ติแฟกต์ที่คุณต้องการในไฟล์ build.gradle
สำหรับแอปหรือโมดูลของคุณ
ดึงดูด
dependencies {
implementation "androidx.navigation3:navigation3-runtime:1.0.0-alpha07"
implementation "androidx.navigation3:navigation3-ui:1.0.0-alpha07"
}
Kotlin
dependencies {
implementation("androidx.navigation3:navigation3-runtime:1.0.0-alpha07")
implementation("androidx.navigation3:navigation3-ui:1.0.0-alpha07")
}
ดูข้อมูลเพิ่มเติมเกี่ยวกับการพึ่งพาได้ที่เพิ่มการพึ่งพาบิลด์
ความคิดเห็น
ความคิดเห็นของคุณช่วยเราปรับปรุง Jetpack ให้ดียิ่งขึ้น โปรดแจ้งให้เราทราบหากพบปัญหาใหม่หรือมี
ไอเดียในการปรับปรุงไลบรารีนี้ โปรดดูปัญหาที่มีอยู่
ในไลบรารีนี้ก่อนสร้างปัญหาใหม่ คุณสามารถโหวตปัญหาที่มีอยู่ได้โดย
คลิกปุ่มดาว
สร้างปัญหาใหม่
ดูข้อมูลเพิ่มเติมได้ในเอกสารประกอบของเครื่องมือติดตามปัญหา
ไม่มีบันทึกประจำรุ่นสำหรับอาร์ติแฟกต์นี้
รุ่น 1.0
เวอร์ชัน 1.0.0-alpha07
13 สิงหาคม 2025
androidx.navigation3:navigation3-*:1.0.0-alpha07
ได้รับการเผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha07 มีคอมมิตเหล่านี้
การอัปเดต MinSdk
การเปลี่ยนแปลง API
- ตอนนี้
SavedStateNavEntryDecorator
ใช้ SaveableStateRegistry
ที่สร้างไว้ใน SaveableStateProvider
เพื่อบันทึกและกู้คืนสถานะ (If8d9a)
- ตอนนี้
predictivePopTransitionSpec
จะมีขอบการปัดเป็นพารามิเตอร์ ซึ่งช่วยให้คุณปรับแต่งการเปลี่ยนผ่านตามขอบที่ผู้ใช้เริ่มท่าทางสัมผัสย้อนกลับแบบคาดการณ์ (I753a8)
การแก้ไขข้อบกพร่อง
- แก้ไขปัญหาที่ทำให้ระบบคำนวณฉากที่กำหนดเองซ้ำไม่สิ้นสุดเนื่องจากระบบไม่จดจำฉากล่าสุด (I7ba84, b/418153031)
การอัปเดตการขึ้นต่อกัน
เวอร์ชัน 1.0.0-alpha06
30 กรกฎาคม 2025
androidx.navigation3:navigation3-*:1.0.0-alpha06
ได้รับการเผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha06 มีการเปลี่ยนแปลงเหล่านี้
การอัปเดตการขึ้นต่อกัน
เวอร์ชัน 1.0.0-alpha05
2 กรกฎาคม 2025
androidx.navigation3:navigation3-*:1.0.0-alpha05
ได้รับการเผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha05 มีการคอมมิตเหล่านี้
การเปลี่ยนแปลงลักษณะการทำงาน
- ตอนนี้สถานะของ
NavEntry
จะอิงตามรายการตกแต่งปัจจุบันที่ส่งไปยัง NavDisplay
อย่างเคร่งครัด ซึ่งหมายความว่าควรสลับ Decorator ตามสแต็กย้อนกลับในกรณีที่มีสแต็กย้อนกลับหลายรายการเพื่อรักษาสถานะของ NavEntry ในสแต็กย้อนกลับ ไม่เช่นนั้น ระบบจะล้างสถานะราวกับว่ามีการป๊อปรายการ (แทนที่จะเป็นการสลับ) (I7a759, b/428033667)
เวอร์ชัน 1.0.0-alpha04
18 มิถุนายน 2025
androidx.navigation3:navigation3-*:1.0.0-alpha04
ได้รับการเผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha04 มีการเปลี่ยนแปลงเหล่านี้
การเปลี่ยนแปลง API
- ตอนนี้
NavEntry.content
เป็นแบบส่วนตัวแล้ว หากต้องการเรียกใช้NavEntry
เนื้อหา ให้เรียกใช้NavEntry.Content()
API ใหม่ซึ่งไม่จำเป็นต้องใช้พารามิเตอร์ key
ในการเรียกใช้ (Icd0fd, b/420991203)
- ตอนนี้
NavEntry.key
เป็นฟิลด์ส่วนตัวแล้ว NavEntry
และสถานะที่เกี่ยวข้องควรระบุโดยฟิลด์ contentKey
ใหม่ซึ่งสร้างจาก Lambda contentKeyFactory
ใหม่และค่าเริ่มต้นเป็นแฮชที่บันทึกได้ซึ่งสร้างจาก NavEntry.key
(I81a6c, b/422001357, b/420991203 I2d7d4, b/420991203, b/422841812)
การเปลี่ยนแปลงการขึ้นต่อกัน
- ตอนนี้ Navigation3 ขึ้นอยู่กับอาร์ติแฟกต์
androidx.navigationevent.compose
ใหม่แล้ว
เวอร์ชัน 1.0.0-alpha03
4 มิถุนายน 2025
androidx.navigation3:navigation3-*:1.0.0-alpha03
ได้รับการเผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha03 มีคอมมิตเหล่านี้
การแก้ไขข้อบกพร่อง
Navigation3
จะไม่ล้างสถานะ Decorator สำหรับ backStacks
ที่มีการสลับออกและแทนที่ด้วยอินสแตนซ์ backStack
อื่นอีกต่อไป (I28a42, b/415076044)
เวอร์ชัน 1.0.0-alpha02
23 พฤษภาคม 2025
androidx.navigation3:navigation3-*:1.0.0-alpha02
ได้รับการเผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha02 มีการคอมมิตเหล่านี้
การแก้ไขข้อบกพร่อง
- แก้ไขปัญหาเกี่ยวกับ
SavedStateNavEntryDecorator
ซึ่งทำให้เกิดการชนกันสำหรับคลาสข้อมูลต่างๆ ที่มีค่าพร็อพเพอร์ตี้เดียวกัน (b/418070648, Iff4775)
- แก้ไขปัญหาคลาสที่ขาดหายไปซึ่งอาจทำให้เกิดข้อขัดข้องเมื่อเรียกใช้โดยไม่ได้ประกาศการอ้างอิงที่ชัดเจน (b/419049149, I4b4ed)
เวอร์ชัน 1.0.0-alpha01
20 พฤษภาคม 2025
androidx.navigation3:navigation3-*:1.0.0-alpha01
ได้รับการเผยแพร่แล้ว เวอร์ชัน 1.0.0-alpha01 มีการเปลี่ยนแปลงเหล่านี้
ฟีเจอร์ใหม่
Navigation3 เป็นไลบรารีการนำทางใหม่ที่สร้างขึ้นเพื่อจัดการการนำทางในแอป Jetpack Compose โดยเฉพาะ androidx.navigation3.runtime
อาร์ติแฟกต์เป็นส่วนประกอบพื้นฐาน ส่วนandroidx.navigation3.ui
อาร์ติแฟกต์เป็นเลเยอร์ UI ผ่าน NavDisplay
API นักพัฒนาแอปสามารถระบุสถานะของตนเองโดยตรงไปยังฟังก์ชันที่ใช้ร่วมกันได้ของ NavDisplay
ซึ่งจะเปลี่ยนเนื้อหาตามการเปลี่ยนแปลงในสถานะของนักพัฒนาแอป
@Serialiable object Home : NavKey
@Serialiable object Chat : NavKey
val backStack = rememberNavBackStack(Home)
NavDisplay(backStack, entryProvider = entryProvider {
entry<Home> {
Column {
Text(“Home”)
Button(onClick = { backStack.add(Chat) } ) {
Text(“Go to Chat”)
}
}
}
entry<Chat> { /* My Composable Content */ }
})
ดูข้อมูลเพิ่มเติมได้ที่คู่มือ Navigation3
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-13 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-13 UTC"],[],[],null,["# navigation3\n===========\n\nAPI Reference \n[androidx.navigation3.runtime](/reference/kotlin/androidx/navigation3/runtime/package-summary) \n[androidx.navigation3.ui](/reference/kotlin/androidx/navigation3/ui/package-summary) \nNavigation 3 is a new navigation library designed to work with Compose. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|-----------------|----------------|-------------------|--------------|-----------------------------------------------------------------------|\n| August 13, 2025 | - | - | - | [1.0.0-alpha07](/jetpack/androidx/releases/navigation3#1.0.0-alpha07) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on navigation3, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\ndependencies {\n implementation \"androidx.navigation3:navigation3-runtime:1.0.0-alpha07\"\n implementation \"androidx.navigation3:navigation3-ui:1.0.0-alpha07\"\n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n implementation(\"androidx.navigation3:navigation3-runtime:1.0.0-alpha07\")\n implementation(\"androidx.navigation3:navigation3-ui:1.0.0-alpha07\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:1750212%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=1750212&template=2102223)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nThere are no release notes for this artifact.\n\nVersion 1.0\n-----------\n\n### Version 1.0.0-alpha07\n\nAugust 13, 2025\n\n`androidx.navigation3:navigation3-*:1.0.0-alpha07` is released. Version 1.0.0-alpha07 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/b4562c71af5649ad7262ba4c7925899e6e93bdff..c359e97fece91f3767a7d017e9def23c7caf1f53/navigation3).\n\n**MinSdk Update**\n\n- The default minSdk for the AndroidX has been moved from API 21 to API 23 ([Ibdfca](https://android-review.googlesource.com/#/q/Ibdfca5942dbb414ca07594ba240093db14aad4df), [b/380448311](https://issuetracker.google.com/issues/380448311), [b/435705964](https://issuetracker.google.com/issues/435705964), [b/435705223](https://issuetracker.google.com/issues/435705223))\n\n**API Changes**\n\n- `SavedStateNavEntryDecorator` now uses the `SaveableStateRegistry` built into `SaveableStateProvider` to save and restore states. ([If8d9a](https://android-review.googlesource.com/#/q/If8d9aebde301f51faa78d4b1f471cf9f7d87f9cb))\n- The `predictivePopTransitionSpec` is now provided the swipe edge as a parameter, allowing you to customize the transition based on what edge the user started the Predictive Back gesture from. ([I753a8](https://android-review.googlesource.com/#/q/I753a8ba909347f89506006f66aca23298b2e3237))\n\n**Bug Fixes**\n\n- Fixed an issue that would cause custom scenes to be infinitely recalculated because the most recent scene was not being remembered. ([I7ba84](https://android-review.googlesource.com/#/q/I7ba84a56fe1cfd4f006c9b6c4c3e91b44a2bb2a5), [b/418153031](https://issuetracker.google.com/issues/418153031))\n\n**Dependency update**\n\n- Navigation3 now depends on [Navigation Event `1.0.0-alpha06`](/jetpack/androidx/releases/jetpack/androidx/releases/navigationevent#1.0.0-alpha06).\n\n### Version 1.0.0-alpha06\n\nJuly 30, 2025\n\n`androidx.navigation3:navigation3-*:1.0.0-alpha06` is released. Version 1.0.0-alpha06 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/c920d69612c07600c8d244ef8fe3df5ec775da88..b4562c71af5649ad7262ba4c7925899e6e93bdff/navigation3).\n\n**Dependency Update**\n\n- Navigation3 now depends on [Navigation Event `1.0.0-alpha05`](/jetpack/androidx/releases/navigationevent#1.0.0-alpha05).\n\n### Version 1.0.0-alpha05\n\nJuly 2, 2025\n\n`androidx.navigation3:navigation3-*:1.0.0-alpha05` is released. Version 1.0.0-alpha05 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/3a0aa7a0552da83ba3994838f5db40d0d7a6196f..c920d69612c07600c8d244ef8fe3df5ec775da88/navigation3).\n\n**Behavior Changes**\n\n- The `NavEntry`'s state is now strictly based on the current list of decorators passed to the `NavDisplay`. This means that decorators should be swapped along your back stacks in the case of multiple back stacks in order to preserve the state of the NavEntries on the back stack. Otherwise, the states will be cleared as if the entries were popped (instead of a swap). ([I7a759](https://android-review.googlesource.com/#/q/I7a759e37580404cf9c3a35b1c2a8f18b3d20646e), [b/428033667](https://issuetracker.google.com/issues/428033667))\n\n### Version 1.0.0-alpha04\n\nJune 18, 2025\n\n`androidx.navigation3:navigation3-*:1.0.0-alpha04` is released. Version 1.0.0-alpha04 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/4fb12d1b1dc4dcae8ca603c7a5db938cc1abe39c..b454ea392cd18cccb078ef60a3221719164f7bbc/navigation3).\n\n**API Changes**\n\n- `NavEntry.content` is now private. To invoke `NavEntry` content, call the new `NavEntry.Content()` api which no longer requires a `key` parameter to invoke. ([Icd0fd](https://android-review.googlesource.com/#/q/Icd0fd2244c3d29557b0803ef2abb199c18cbdbdc), [b/420991203](https://issuetracker.google.com/issues/420991203))\n- `NavEntry.key` is now a private field. The `NavEntry` and its relevant states should be identified by the new `contentKey` field which is generated from the new `contentKeyFactory` lambda and defaults to a saveable hash generated from `NavEntry.key` ([I81a6c](https://android-review.googlesource.com/#/q/I81a6ced3a7bebf561c7206fcdf9402bc80c12752), [b/422001357](https://issuetracker.google.com/issues/422001357), [b/420991203](https://issuetracker.google.com/issues/420991203) [I2d7d4](https://android-review.googlesource.com/#/q/I2d7d4daba257e19bc9abe5ea64540126af18adf0), [b/420991203](https://issuetracker.google.com/issues/420991203), [b/422841812](https://issuetracker.google.com/issues/422841812))\n\n**Dependency Changes**\n\n- Navigation3 now depends on the new `androidx.navigationevent.compose` artifact.\n\n### Version 1.0.0-alpha03\n\nJune 4, 2025\n\n`androidx.navigation3:navigation3-*:1.0.0-alpha03` is released. Version 1.0.0-alpha03 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/3db836162afb266b54eb37d28c7c12231755fc9b..4fb12d1b1dc4dcae8ca603c7a5db938cc1abe39c/navigation3).\n\n**Bug Fixes**\n\n- `Navigation3` will no longer clear decorator states for `backStacks` that have been swapped out and replaced with another `backStack` instance. ([I28a42](https://android-review.googlesource.com/#/q/I28a42b98cc811be99d8380b1cfceee02b42608ab), [b/415076044](https://issuetracker.google.com/issues/415076044))\n\n### Version 1.0.0-alpha02\n\nMay 23, 2025\n\n`androidx.navigation3:navigation3-*:1.0.0-alpha02` is released. Version 1.0.0-alpha02 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/1c211305886d70caa42620facce1b97ed7e47bf5..3db836162afb266b54eb37d28c7c12231755fc9b/navigation3).\n\n**Bug Fixes**\n\n- Fixed an issue with the `SavedStateNavEntryDecorator` which caused collisions for different data classes with the same property values. ([b/418070648](https://issuetracker.google.com/418070648), [Iff4775](https://android-review.googlesource.com/#/q/Iff47751d5de26bfee744069461cee38419988699))\n- Fixed a missing class issue that would cause crashes when running without declaring explicit dependencies. ([b/419049149](https://issuetracker.google.com/419049149), [I4b4ed](https://android-review.googlesource.com/#/q/I4b4edbf046a62164e56e1871ca9918d9683a2abf))\n\n### Version 1.0.0-alpha01\n\nMay 20, 2025\n\n`androidx.navigation3:navigation3-*:1.0.0-alpha01` is released. Version 1.0.0-alpha01 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/1c211305886d70caa42620facce1b97ed7e47bf5/navigation3).\n\n**New Features**\n\n[Navigation3](https://developer.android.com/guide/navigation/navigation-3) is a new navigation library built specifically to handle Jetpack Compose in-app navigation. The `androidx.navigation3.runtime` artifact provides the building blocks, while the `androidx.navigation3.ui` artifact provides the UI layer via the `NavDisplay` API. Developers can provide their own state directly to the `NavDisplay` composable function, which changes the content based on changes in the developer state. \n\n @Serialiable object Home : NavKey\n @Serialiable object Chat : NavKey\n\n val backStack = rememberNavBackStack(Home)\n\n NavDisplay(backStack, entryProvider = entryProvider {\n entry\u003cHome\u003e {\n Column {\n Text(\"Home\")\n Button(onClick = { backStack.add(Chat) } ) {\n Text(\"Go to Chat\")\n } \n }\n }\n entry\u003cChat\u003e { /* My Composable Content */ }\n })\n\nFor more information, see the [Navigation3 guide](http://goo.gle/nav3)."]]