navigation-3
Skill này làm gì
Skill này hướng dẫn cài đặt và chuyển sang Jetpack Navigation 3, thư viện điều hướng mới hơn cho Android. Nó cũng bao quát các mẫu như liên kết sâu, nhiều ngăn xếp quay lại và bottom sheet. Nó dành cho lập trình viên Android đang chuyển sang hoặc xây dựng với Navigation 3.
Khi nào nên dùng
- ✓Khi bạn muốn chuyển ứng dụng Android từ Navigation 2 sang Navigation 3.
- ✓Khi bạn cần nhiều ngăn xếp quay lại, chẳng hạn các tab riêng với lịch sử riêng.
- ✓Khi bạn muốn liên kết sâu, hộp thoại hoặc bottom sheet được xử lý qua điều hướng.
Liên kết skill
https://github.com/android/skills/blob/main/navigation/navigation-3/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chuyển ứng dụng Android của tôi từ Navigation 2 sang Navigation 3 và giữ các màn hình hoạt động như cũ.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill làm theo hướng dẫn chuyển đổi, bao gồm cập nhật phụ thuộc, thay đổi route và xử lý trạng thái. Sau đó nó chỉ cách thiết lập các mẫu như liên kết sâu, scene và kết quả trả về từ các luồng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Migration guide
- Navigation 2 to Navigation 3 migration guide: 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 : 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. 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: Shows most basic API usage.
- Saveable back stack: Shows basic API usage with a persistent back stack.
- Entry provider DSL: Shows basic API usage using the entryProvider DSL.
Common UI
- Common UI: 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: Shows how to handle simple static URI deep links.
- URI with Arguments: Shows how to parse path and query arguments from a deep link.
- Synthetic BackStack: Shows how to handle deep links with a synthetic back stack.
- Custom Matcher: Shows how to implement custom deep link matching logic.
Scenes
Use built-in Scenes
- Dialog: Shows how to create a Dialog.
Create custom Scenes
- BottomSheet: Shows how to create a BottomSheet destination.
- List-Detail Scene: Demonstrates how to implement adaptive list-detail layouts using the Navigation 3 Scenes API.
- Two pane Scene: Demonstrates how to implement adaptive two-pane layouts using the Navigation 3 Scenes API.
Material Adaptive
- Material List-Detail: Demonstrates how to implement an adaptive list-detail layout using Material 3 Adaptive.
- Material Supporting Pane: Demonstrates how to implement an adaptive supporting pane layout using Material 3 Adaptive.
Animations
- Animations: Shows how to override the default animations for all destinations and a single destination.
- Conditional Transitions: Shows how to implement conditional transition animations.
Common back stack behavior
- Multiple back stacks: 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
Câu hỏi thường gặp
Nó có bao quát việc chuyển từ route dạng chuỗi không?
Có. Nó chỉ tới một hướng dẫn về điều hướng kiểu an toàn trong Compose như một phần của việc chuyển đổi.
Nó có giúp với luồng đã đăng nhập và chưa đăng nhập không?
Có. Nó bao quát điều hướng có điều kiện, chẳng hạn hiển thị các màn hình khác nhau cho người dùng đã đăng nhập và người dùng ẩn danh.
Nó có bao quát Hilt và ViewModel không?
Có. Nó bao gồm tích hợp với Hilt, ViewModel và Kotlin.
Chi tiết
Mô tả gốc của tác giả
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.
repo: android/skills
Độ phổ biến
- Sao GitHub
- 10k
- Vị trí xếp hạng
- #11924
- Giấy phép
- Apache-2.0
- Cập nhật
- 29/10/2026
Bình luận
- …
Thêm skill từ kho mã này
agp-9-upgrade
10kGiúp agent của bạn nâng cấp ứng dụng Android lên Android Gradle Plugin 9 và xử lý các thay đổi gây lỗi. Không dành cho dự án đa nền tảng.
camerax
10kGiúp agent của bạn xây dựng các tính năng camera Android bằng CameraX, gồm quay video, điều khiển phần cứng, ML Kit và hiệu ứng Media3.
android-for-cars-parked-apps
10kĐiều chỉnh một ứng dụng video, trò chơi hoặc trình duyệt Android để chạy như ứng dụng khi xe đỗ trên Android Auto và Android Automotive.
appfunctions
10kTìm các luồng công việc chính trong ứng dụng Android và công khai chúng dưới dạng AppFunctions để agent AI và lệnh giọng nói có thể chạy.
Skill tương tự
android-clean-architecture
280kGiúp agent của bạn tổ chức dự án Android hiệu quả, cấu trúc code để việc bảo trì và phát triển tính năng mới dễ dàng hơn.
compose-multiplatform-patterns
280kGiúp agent của bạn dùng các mẫu Compose Multiplatform và Jetpack Compose trong dự án KMP, gồm trạng thái, điều hướng, giao diện và hiệu năng.
dart-flutter-patterns
280kGiúp agent của bạn viết code cho ứng dụng Dart và Flutter. Agent dùng các mẫu hiện đại để tạo ứng dụng vững chắc và dễ quản lý.