migrate-xml-views-to-jetpack-compose
This skill walks you through systematically converting legacy XML layouts into declarative Jetpack Compose components. Following a 10-step methodology—from candidate selection and dependency setup through theming, migration, validation, and cleanup—you'll achieve pixel-perfect visual parity while preserving functional integrity and project conventions.
migrate-xml-views-to-jetpack-compose guides you through converting legacy Android XML layouts to modern Jetpack Compose UI.
AI-generated summary based on this skill's SKILL.md
Install
android/skills/migrate-xml-views-to-jetpack-compose · repository language: Python
git clone https://github.com/android/skills
cp -r skills/jetpack-compose/migration/migrate-xml-views-to-jetpack-compose ~/.claude/skills/migrate-xml-views-to-jetpack-composeFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I migrate XML views to Jetpack Compose?
migrate-xml-views-to-jetpack-compose walks you through a 10-step methodology for converting legacy XML layouts into declarative Compose components. Start by selecting migration candidates, set up Jetpack Compose dependencies and theming, then systematically convert XML Views to modern Compose components while maintaining interoperability. The skill guides you through validation, testing, and cleanup to achieve pixel-perfect visual parity while preserving functional integrity.
What's the step-by-step process for converting Android XML layouts to Compose?
migrate-xml-views-to-jetpack-compose provides a structured 10-step approach: identify candidate screens, establish Compose dependencies, configure theming to match your design system, convert XML layouts to Compose equivalents, replace legacy Views with Compose components, validate visual and functional parity, test interoperability between old and new code, update project conventions, perform cleanup, and document the migration. This incremental workflow lets you modernize your UI without disrupting active development.
How can I set up Jetpack Compose dependencies and theming for XML migration?
migrate-xml-views-to-jetpack-compose covers dependency setup and theming configuration as core steps in the migration process. The skill shows you how to add required Compose libraries to your project, establish a cohesive Material Design theme that matches your existing XML design system, and ensure visual consistency across both declarative and legacy code. Proper theming upfront prevents rework and maintains design integrity throughout the migration.
Can I replace XML Views with Compose while maintaining interop?
Yes. migrate-xml-views-to-jetpack-compose emphasizes validation and interoperability as key steps. The skill teaches you how to run both XML and Compose code side-by-side, test functional equivalence, and use Compose's interop APIs to embed Compose components in XML layouts and vice versa. This approach lets you migrate incrementally without forcing a complete rewrite, preserving your project's stability and team velocity.
What does incremental UI modernization from XML to Compose involve?
migrate-xml-views-to-jetpack-compose supports incremental modernization by letting you migrate one screen or component at a time rather than all at once. The skill guides you through planning which screens to convert first, executing the migration in phases, validating each phase independently, and maintaining interoperability between old and new code. This staged approach reduces risk, allows parallel development, and lets you learn Compose gradually while keeping your app stable.
How do I validate that my Compose migration maintains visual and functional parity?
migrate-xml-views-to-jetpack-compose includes validation as a dedicated step in the 10-step methodology. The skill teaches you how to compare XML and Compose implementations side-by-side, test user interactions, verify layout dimensions and spacing, check theme application, and ensure all business logic works identically. Thorough validation before cleanup prevents regressions and gives you confidence that your modernized UI behaves exactly like the original.
SKILL.md
rendered from the published skill — quoted content, verbatim
This skill guides through the process of migrating an existing Android XML View to Jetpack Compose. It performs a stable, safe and visually consistent transition by following a structured, 10-step methodology. This skill migrates UI (XML to Jetpack Compose) only.
Objective
To systematically convert a single legacy XML layout into modern, declarative Jetpack Compose UI while maintaining pixel-perfect visual parity and
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 8 files
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/SKILL.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/references/analysis-of-the-project-and-layout.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/references/android/develop/ui/compose/designsystems/migrate-xml-theme-to-compose.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/references/android/develop/ui/compose/migrate/interoperability-apis/compose-in-views.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/references/android/develop/ui/compose/migrate/interoperability-apis/views-in-compose.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/references/android/develop/ui/compose/setup-compose-dependencies-and-compiler.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/references/identify-optimal-xml-candidate.md
jetpack-compose/migration/migrate-xml-views-to-jetpack-compose/references/xml-layout-migration.md