DailyDeskTools home

Views Are in Maintenance Mode: Move from XML to Compose

Android Views are now in maintenance mode and Android is Compose First. What that means for your XML layouts, the real migration results, and three ways to move to Jetpack Compose.

By the DailyDeskTools team · · 8 min read

If your Android app is built with XML layouts, 2026 changed the plan. In May, Google announced that Android UI development is Compose First and that the View system is in maintenance mode. This week at Android Dev Summit, Android Studio added an AI assistant that migrates XML layouts to Jetpack Compose for you.

Your XML screens still work. But every new UI feature, library and tool from now on is Compose only. This guide explains what changed, what other teams gained by moving, and three practical ways to migrate, from a fully automated route to converting one layout at a time.

Watch it in action: Android is now Compose First and Views are in maintenance mode. See how to convert an Android XML layout to Jetpack Compose code in your browser: paste the layout, name the composable and copy the Kotlin.Try the XML to Compose Converter

What changed in 2026

May 2026: Compose First. On the Android Developers Blog, Google said View components are now in maintenance mode. They get critical bug fixes, but no new features, and all new APIs, libraries, tools and guidance come in Compose only. Google's Compose First page adds that View-based libraries such as RecyclerView and Fragments follow the same path.

October 2026: migration tooling. At Android Dev Summit, the Android Studio team introduced a Migration Assistant. You right-click an XML layout and choose AI > Migrate to Compose, or run it across the whole project. It is in Android Studio Canary for now.

What "maintenance mode" does and doesn't mean

It does not mean your app breaks. Google says it has "no plans to deprecate or remove View components", so existing XML apps keep building and running.

What it does mean:

  • No new View features. New Material components, adaptive layouts and UI APIs arrive in Compose only.
  • Guidance and samples move to Compose. Documentation, codelabs and libraries will assume Compose.
  • The gap grows every year. The longer an app stays on Views, the more of the platform it misses, and the harder hiring and onboarding become.

XML Views vs Jetpack Compose

XML Views Jetpack Compose
Style Imperative: you change views with calls like setText() Declarative: the UI is drawn from your state
Files per screen An XML layout plus Kotlin or Java code One Kotlin file
Wiring findViewById, View Binding or Data Binding None, state flows straight into the UI
Lists RecyclerView with an adapter LazyColumn with a few lines
Previews Layout editor @Preview functions in code

A small example shows the difference. Here is a settings card in XML:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="16dp">

    <TextView
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Notifications"
        android:textSize="20sp"
        android:textStyle="bold" />

    <Switch
        android:id="@+id/email_updates"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:text="Email me updates" />

    <Button
        android:id="@+id/save"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:text="Save" />
</LinearLayout>

The layout does nothing on its own. You also need code in another file to find the views and react to them:

binding.emailUpdates.setOnCheckedChangeListener { _, checked ->
    viewModel.setEmailUpdates(checked)
}
binding.save.setOnClickListener { viewModel.save() }

The same screen in Compose is one function, and the switch's state lives right next to it:

@Composable
fun NotificationSettings() {
    var emailUpdatesChecked by remember { mutableStateOf(false) }

    Column(
        modifier = Modifier
            .fillMaxWidth()
            .padding(16.dp)
    ) {
        Text(text = "Notifications", fontSize = 20.sp, fontWeight = FontWeight.Bold)
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .padding(top = 8.dp),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text(text = "Email me updates", modifier = Modifier.weight(1f))
            Switch(
                checked = emailUpdatesChecked,
                onCheckedChange = { emailUpdatesChecked = it }
            )
        }
        Button(
            onClick = { /* TODO */ },
            modifier = Modifier
                .fillMaxWidth()
                .padding(top = 16.dp)
        ) {
            Text(text = "Save")
        }
    }
}

That Compose code was generated from the XML above by our free XML to Compose converter, unedited.

What teams gained by moving

Two migrations published this year give real numbers. Both are self-reported by the companies, so treat them as examples rather than guarantees.

Instagram Direct. In a write-up on the Android Developers Blog, Instagram's engineers say moving Direct's UI to Compose cut the amount of UI code by about 50% on the migrated screens. Because they also use AI coding agents, they measured those too: InfoQ reports 33% lower token cost per agent session, 35% shorter agent run time and 32% fewer back-and-forth exchanges between engineers and agents.

Shopify's Shop app. Shopify rebuilt its Shop app from React Native as native Swift and Kotlin apps. Shopify's engineering team reports Android cold start falling from 4.4 seconds to 2.2 seconds, about 50% faster, measured from tapping the icon to seeing the home feed. The Shop app had not moved to React Native's New Architecture, and The Pragmatic Engineer notes that move gave Shopify's other apps only modest gains, so some of the improvement may reflect the older React Native setup rather than Compose alone.

Why Compose suits AI coding agents

More teams now write code with AI agents, and the shape of the code matters. With XML, an agent has to read a layout file, find the matching Kotlin file, and follow chains of calls that change views over time. With Compose, a screen is one Kotlin function, and what you see is worked out from the state you pass in.

Less code means fewer tokens to read and write, and one language means fewer places for the agent to get things wrong. That is the reasoning behind Instagram's numbers above.

Three ways to migrate

1. Android Studio's Migration Assistant

Best for whole apps or large screens, if your team already works with AI agents.

  1. Install the latest Android Studio Canary.
  2. Right-click an XML layout and choose AI > Migrate to Compose, or run it for the whole project from the action palette.
  3. The agent drafts a plan with you, then works through it. A progress timeline shows each step and where to resume if it stops.

It uses Android Studio's built-in agent, or another coding agent added through Bring Your Own Agent. Review every change like a pull request, and keep it in version control.

2. Convert one layout at a time in your browser

Best for a single screen, a quick start on a new composable, or learning how XML attributes map to Compose.

Paste a layout into the XML to Compose converter and the Kotlin code appears instantly, with imports and a preview function. There's no install, no account and no AI agent involved, and your code never leaves your browser.

It handles the everyday views (LinearLayout, FrameLayout, ScrollView, TextView, Button, EditText, ImageView, CardView, RecyclerView and more) and their common attributes. Things without a one-to-one Compose version, like ConstraintLayout positions or custom views, are marked with clear // TODO comments instead of guessed.

3. Migrate by hand, screen by screen

Best for complex screens and teams that want full control. You don't have to rewrite everything at once, because Compose and Views work together:

  • ComposeView puts Compose inside an existing XML layout or Fragment. Start new features in Compose here.
  • AndroidView puts an old View inside a composable, for custom views you haven't rewritten yet, like a chart or a map.

Google's migration strategy guide recommends exactly this: build new screens in Compose, then move existing ones over time.

A migration checklist for teams

  1. Write new screens in Compose from today. This stops the View code from growing.
  2. Set up a theme first. Create your Compose Material 3 theme from your XML colors, type and shapes, so migrated screens match.
  3. Start with simple, high-traffic screens. Settings, profile and detail screens are good first moves. Leave complex custom views for last.
  4. Move state into ViewModels. Compose works best when screens get state passed in and send events up.
  5. Replace RecyclerView adapters with LazyColumn. This is often where the biggest code savings are.
  6. Add previews and UI tests as you go. Previews make review fast, and tests catch layout mistakes.
  7. Measure. Track startup time, frame rate and APK size before and after, so you have your own numbers.

FAQ

Is Android XML deprecated?

No. Views are in maintenance mode: they get critical fixes but no new features. Google says it has no plans to remove them.

Do I have to rewrite my whole app?

No. ComposeView and AndroidView let Compose and Views live side by side, so you can migrate one screen at a time.

Can XML layouts be converted to Compose automatically?

Yes, two ways. Android Studio Canary's Migration Assistant uses an AI agent to migrate layouts and the code around them. Our free converter converts a layout instantly in your browser with fixed rules, without an AI agent.

What about ConstraintLayout?

There is a ConstraintLayout library for Compose, but many screens are simpler as nested Column, Row and Box layouts. Converters keep the views but can't translate constraints one-to-one, so plan to rebuild those positions by hand.

Sources

Android and Jetpack Compose are trademarks of Google LLC. DailyDeskTools is independent and not affiliated with Google.

Tools mentioned in this article

More articles