界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

android-navigation

android-navigation

【开发与工程】Implement screen routes and deep-link/App Link routing with Jetpack Compose Navigation on Android. Use when the primary task is Compose route configuration or external URL routing; defer typed-route APIs, XML/fragments, generic back-stack, and transition questions to their specific navigation skills.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: android-navigation description: Implement screen routes and deep-link/App Link routing with Jetpack Compose Navigation on Android. Use when the primary task is Compose route configuration or external URL routing; defer typed-route APIs, XML/fragments, generic back-stack, and transition questions to their specific navigation skills. metadata: triggers: files: - '/*Screen.kt' - '/*Activity.kt' - '**/NavGraph.kt' keywords: - NavController - NavHost - composable - navArgument - deepLinks

Android Navigation (Jetpack Compose)

Priority: P2 (MEDIUM)

Guidelines

  • Library: Use androidx.navigation:navigation-compose.
  • Type Safety: Use sealed classes for routes, never raw strings.
  • Deep Links: Configure intent-filter in Manifest and deepLinks in NavHost.
  • Validation: Validate arguments (e.g., proper IDs) before loading content.

Anti-Patterns

  • No String Routes: Use Screen.Product.route instead of "product/$id".
  • No Unvalidated Deep Links: Check resource existence before rendering.
  • No Missing Manifest: Deep links require autoVerify=true intent filters.

References

我的收藏