xml-to-compose-migration

Convert Android XML layouts to Jetpack Compose UI.

915|88|Updated Feb 6, 2024
One-click install
npx skills add https://github.com/new-silvermoon/awesome-android-agent-skills --skill xml-to-compose-migration-new-silvermoon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xml-to-compose-migration
Source: https://github.com/new-silvermoon/awesome-android-agent-skills/tree/main/.github/skills/xml-to-compose-migration
Command: npx skills add https://github.com/new-silvermoon/awesome-android-agent-skills --skill xml-to-compose-migration-new-silvermoon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill systematically migrates Android XML layouts to Jetpack Compose, preserving functionality while adopting Compose patterns, reducing rewrite effort and risk.

Core Features & Use Cases

  • Layout mapping: Converts common container layouts and widgets from XML to their Compose equivalents, with guidance for stateful widgets.
  • Incremental migration: Supports interop strategies, including ComposeView embedding and two-way data binding adaptations.
  • State migration guidance: Recommends converting LiveData/ViewModel state to StateFlow and removing findViewById/ViewBinding patterns.
  • Use Case: A team migrating a legacy screen to Compose without a complete rewrite.

Quick Start

Use the xml-to-compose-migration skill to convert a provided XML layout file into an equivalent Jetpack Compose UI.

Frequently Asked Questions about xml-to-compose-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert an Android XML layout to Jetpack Compose?

Migrating XML layouts to Jetpack Compose involves mapping containers and widgets to Compose equivalents while preserving behavior. This Skill supports incremental component updates and full-screen migrations without requiring a complete rewrite of the application.

Can I migrate LiveData and ViewModel state to StateFlow during the XML to Compose transition?

Yes, this Skill provides state migration guidance to convert LiveData and ViewModel state to StateFlow. It also recommends removing findViewById and ViewBinding patterns to fully adopt Compose state management during the transition.

Does this XML to Compose migration approach support incremental adoption?

Yes, this approach supports incremental XML to Compose migration through interop strategies like ComposeView embedding. It handles two-way data binding adaptations, allowing teams to migrate legacy screens gradually without a complete rewrite.

What is the best way to replace findViewById and data bindings when moving to Jetpack Compose?

The best way to replace findViewById and data bindings is by adopting Compose state management patterns like StateFlow. This Skill provides specific guidance on removing these legacy View patterns and mapping stateful widgets directly to Compose equivalents.

When should I not use an automated XML layout to Compose conversion?

You should not rely solely on automated XML layout to Compose conversion when complex custom views require bespoke Compose implementations. This Skill requires a defined layout-to-Compose mapping and provides interop patterns, but highly custom views may need manual migration.