Navigation 3

android/skills/navigation/navigation-3

作者 android42dc2270e960Complete terms in LICENSE.txt7.7K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫13 天前更新

Learn how to install and migrate to Jetpack Navigation 3, and how to implement features and patterns such as deep links, multiple backstacks, scenes (dialogs, bottom sheets, list-detail, two-pane, supporting pane), conditional navigation (such as logged-in navigation versus anonymous), returning results from flows, integration with Hilt, ViewModel, Kotlin, and view interoperability.

AI 產生的概覽

針對 Android 應用程式的 Jetpack Navigation 3 安裝、移轉與使用參考指南和程式碼範例。

功能
提供 Jetpack Navigation 3 的開發者文件與範例參考,涵蓋安裝、從 Navigation 2 移轉,以及型別安全導覽。文件說明深層連結、多個返回堆疊、場景(對話方塊、底部彈出式面板、清單-詳細資料、雙窗格)、條件式導覽、傳回結果、生命週期,以及使用 Hilt 或 Koin 的模組化等模式。產出的是指引與程式碼範例,而非可執行的成品。
適用情境
在建置或移轉使用 Jetpack Navigation 3 的 Android 應用程式,且需要實作模式或移轉步驟時使用。也適合查閱特定範例,例如深層連結、場景或多個返回堆疊。
執行需求
沒有指令碼,只有說明與參考文件。需要 Android 開發環境,使用 Jetpack Compose 和 Navigation 3;模組化範例可選用 Hilt、Dagger 或 Koin。

Migration guide

  • Navigation 2 to Navigation 3 migration guide [blocked]: Step-by-step guide to migrate an Android application from Navigation 2 to Navigation 3, covering dependency updates, route changes, state management, and UI component replacements.

Requirements

  • Guide: Migrate to type-safe navigation in Compose [blocked] : Step-by-step guide to migrating an Android application from string-based navigation to Type-Safe Navigation in Jetpack Compose using Jetpack Navigation 2.

Developer documentation

  • Navigation 3 [blocked]. Search documentation for more information on basics, saving and managing navigation state, modularizing navigation code, creating custom layouts using Scenes, animating between destinations, or applying logic or wrappers to destinations.

Recipes

Code examples showcasing common patterns.

Basic API usage

  • Basic [blocked]: Shows most basic API usage.
  • Saveable back stack [blocked]: Shows basic API usage with a persistent back stack.
  • Entry provider DSL [blocked]: Shows basic API usage using the entryProvider DSL.

Common UI

  • Common UI [blocked]: Demonstrates how to implement a common navigation UI pattern with a bottom navigation bar and multiple back stacks, where each tab in the navigation bar has its own navigation history.

Deep links

  • Static URI [blocked]: Shows how to handle simple static URI deep links.
  • URI with Arguments [blocked]: Shows how to parse path and query arguments from a deep link.
  • Synthetic BackStack [blocked]: Shows how to handle deep links with a synthetic back stack.
  • Custom Matcher [blocked]: Shows how to implement custom deep link matching logic.

Scenes

Use built-in Scenes
  • Dialog [blocked]: Shows how to create a Dialog.
Create custom Scenes
  • BottomSheet [blocked]: Shows how to create a BottomSheet destination.
  • List-Detail Scene [blocked]: Demonstrates how to implement adaptive list-detail layouts using the Navigation 3 Scenes API.
  • Two pane Scene [blocked]: Demonstrates how to implement adaptive two-pane layouts using the Navigation 3 Scenes API.

Material Adaptive

  • Material List-Detail [blocked]: Demonstrates how to implement an adaptive list-detail layout using Material 3 Adaptive.
  • Material Supporting Pane [blocked]: Demonstrates how to implement an adaptive supporting pane layout using Material 3 Adaptive.

Animations

  • Animations [blocked]: Shows how to override the default animations for all destinations and a single destination.
  • Conditional Transitions [blocked]: Shows how to implement conditional transition animations.

Common back stack behavior

  • Multiple back stacks [blocked]: Shows how to create multiple top level routes, each with its own back stack. Top level routes are displayed in a navigation bar allowing users to switch between them. State is retained for each top level route, and the navigation state persists config changes and process death.

Conditional navigation

  • Conditional navigation [blocked]: Switch to a different navigation flow when a condition is met. For example, for authentication or first-time user onboarding.

Lifecycle

  • Lifecycle Owner [blocked]: Shows how to use and observe Lifecycle in Navigation 3.

Architecture

  • Modularized navigation code (Hilt) [blocked]: Demonstrates how to decouple navigation code into separate modules using Hilt or Dagger for DI.
  • Modularized navigation code (Koin) [blocked]: Demonstrates how to decouple navigation code into separate modules using Koin for DI.

Working with ViewModel

Passing navigation arguments
  • Basic ViewModel [blocked] : Navigation arguments are passed to a ViewModel constructed using viewModel()

Returning results

  • Returning Results as Events [blocked] : Returning results as events to content in another NavEntry
  • Returning Results as State [blocked] : Returning results as state stored in a CompositionLocal

來源與署名

來源:android/skills位於navigation/navigation-3提交42dc227

授權條款: Complete terms in LICENSE.txt

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 android/skills 的技能

Wear Compose M3

android

指導建置、更新與移轉 Wear OS Compose Material3 應用程式,並提供標準元件範例與版本規則。

Software Development7.7K13 天前更新

Display Glasses With Jetpack Compose Glimmer

android

Provides guidelines for developing projected Android XR apps for display glasses using the Jetpack Compose Glimmer UI toolkit. This skill covers foundational Glimmer design principles, workflows for implementing Jetpack Compose Glimmer, and interaction models for the glasses form factor. Use this skill to build an Android XR Augmented Experience app with Jetpack Compose Glimmer that adheres to the Glimmer design system for optimized glasses styling.

待分類7.7K13 天前更新

Play Billing Library Version Upgrade

android

引導將 Android 專案從舊版 Google Play 帳務程式庫升級到最新穩定版本。

Software Development7.7K13 天前更新

Leanback To Compose Tv Migration

android

Provides instructions and architectural patterns for migrating Android TV applications from legacy Leanback UI Toolkit, Android Views, or Support Fragments to Jetpack Compose for TV (androidx.tv). Use this skill for Leanback to Compose migrations, including browse screen, settings screen, authentication screen, login screen, or video playback screen migrations, or when replacing BrowseSupportFragment, LeanbackSettingsFragment, PreferenceFragment, BaseLeanbackPreferenceFragmentCompat, VideoSupportFragment, GuidedStepSupportFragment, SearchSupportFragment, VerticalGridSupportFragment, Presenter, ArrayObjectAdapter, or CursorMapper with modern Compose equivalents, implementing immersive carousels with focus memory, Media3 video playback with PlayerSurface, or custom 10-foot hero layouts.

待分類7.7K13 天前更新

Testing Setup

android

分析 Android 專案的測試設定,並安裝測試框架、測試基礎設施,以及單元、UI、截圖與端對端測試。

Software Development7.7K13 天前更新

Android Profiler

android

引導 Android 效能分析:錄製系統追蹤、堆積轉儲與方法記錄,並以 Perfetto SQL 進行分析。

Software Development7.7K13 天前更新
Navigation 3 · navigation/navigation-3 代理程式技能 | SourceWeft