コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
navigation3
Navigation 3 は、Compose と連携するように設計された新しいナビゲーション ライブラリです。
最新の更新 |
安定版リリース |
リリース候補版 |
ベータ版リリース |
アルファ版リリース |
2025 年 8 月 13 日 |
- |
- |
- |
1.0.0-alpha07 |
依存関係の宣言
navigation3 への依存関係を追加するには、Google の Maven リポジトリをプロジェクトに追加する必要があります。詳しくは、Google の Maven リポジトリをご覧ください。
アプリまたはモジュールの build.gradle
ファイルに、必要なアーティファクトの依存関係を追加します。
Groovy
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 改善の参考にさせていただきます。新しい問題が見つかった場合や、このライブラリを改善するアイデアをお持ちの場合は、お知らせください。新しい問題を報告していただく前に、このライブラリの既存の問題をご確認ください。スターボタンをクリックすると、既存の問題に投票できます。
新しい問題を報告する
詳細については、Issue Tracker のドキュメントをご覧ください。
このアーティファクトのリリースノートはありません。
バージョン 1.0
バージョン 1.0.0-alpha07
2025 年 8 月 13 日
androidx.navigation3:navigation3-*:1.0.0-alpha07
がリリースされました。バージョン 1.0.0-alpha07 には、これらの commit が含まれています。
MinSdk の更新
API の変更
SavedStateNavEntryDecorator
は、SaveableStateProvider
に組み込まれた SaveableStateRegistry
を使用して状態を保存、復元するようになりました。(If8d9a)
predictivePopTransitionSpec
にスワイプ エッジがパラメータとして提供されるようになり、ユーザーが予測型「戻る」ジェスチャーを開始したエッジに基づいてトランジションをカスタマイズできるようになりました。(I753a8)
バグの修正
依存関係の更新
バージョン 1.0.0-alpha06
2025 年 7 月 30 日
androidx.navigation3:navigation3-*:1.0.0-alpha06
がリリースされました。バージョン 1.0.0-alpha06 にはこれらの commit が含まれています。
依存関係の更新
バージョン 1.0.0-alpha05
2025 年 7 月 2 日
androidx.navigation3:navigation3-*:1.0.0-alpha05
がリリースされました。バージョン 1.0.0-alpha05 には、これらの commit が含まれています。
動作の変更
NavEntry
の状態は、NavDisplay
に渡された現在のデコレータのリストに厳密に基づいています。つまり、バックスタック上の NavEntry の状態を保持するために、複数のバックスタックがある場合は、デコレータをバックスタックに沿って入れ替える必要があります。それ以外の場合、エントリが(スワップではなく)ポップされたかのように状態がクリアされます。(I7a759、b/428033667)
バージョン 1.0.0-alpha04
2025 年 6 月 18 日
androidx.navigation3:navigation3-*:1.0.0-alpha04
がリリースされました。バージョン 1.0.0-alpha04 にはこれらの commit が含まれています。
API の変更
依存関係の変更
- Navigation3 は新しい
androidx.navigationevent.compose
アーティファクトに依存するようになりました。
バージョン 1.0.0-alpha03
2025 年 6 月 4 日
androidx.navigation3:navigation3-*:1.0.0-alpha03
がリリースされました。バージョン 1.0.0-alpha03 にはこれらの commit が含まれています。
バグの修正
Navigation3
は、スワップアウトされて別の backStack
インスタンスに置き換えられた backStacks
のデコレータ状態をクリアしなくなります。(I28a42、b/415076044)
バージョン 1.0.0-alpha02
2025 年 5 月 23 日
androidx.navigation3:navigation3-*:1.0.0-alpha02
がリリースされました。バージョン 1.0.0-alpha02 にはこれらの commit が含まれています。
バグの修正
バージョン 1.0.0-alpha01
2025 年 5 月 20 日
androidx.navigation3:navigation3-*:1.0.0-alpha01
がリリースされました。バージョン 1.0.0-alpha01 にはこれらの commit が含まれています。
新機能
Navigation3 は、Jetpack Compose のアプリ内ナビゲーションを処理するために特別に構築された新しいナビゲーション ライブラリです。androidx.navigation3.runtime
アーティファクトは構成要素を提供し、androidx.navigation3.ui
アーティファクトは NavDisplay
API を介して UI レイヤを提供します。デベロッパーは、独自の状態を 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)."]]