Skip to content
Back to skills

Android Compose Migration

ASecurity

Use `LazyColumn` for a vertically scrolling `RecyclerView` with `LinearLayoutManager`, and `LazyRow` for a horizontal one. Items are composed lazily instead of creating one large static layout. ```kotlin @Composable fun MessageList( messages: List<Message>, onMessageClick: (Message) -> Unit, ) { val listState = rememberLazyListState() LazyColumn( state = listState, modifier = Modifier.fillMaxSize(), contentPadding = PaddingValues(vertical = 8.dp), verticalArrangement = Arrangement.spacedBy(8....

  • 584 stars
  • 0 votes
  • 0 copies
  • 9 views
  • Added September 5, 2026
developmentkotlin

Works with

  • cli

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill android-compose-migration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Android Compose Migration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Android Compose Migration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-android-compose-migration-17b635e8/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-android-compose-migration-17b635e8)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Compose equivalent of `RecyclerView` with `LinearLayoutManager`

Use `LazyColumn` for a vertically scrolling `RecyclerView` with `LinearLayoutManager`, and `LazyRow` for a horizontal one. Items are composed lazily instead of creating one large static layout.

```kotlin
@Composable
fun MessageList(
    messages: List<Message>,
    onMessageClick: (Message) -> Unit,
) {
    val listState = rememberLazyListState()

    LazyColumn(
        state = listState,
        modifier = Modifier.fillMaxSize(),
        contentPadding = PaddingValues(vertical = 8.dp),
        verticalArrangement = Arrangement.spacedBy(8.dp),
    ) {
        items(
            items = messages,
            key = { message -> message.id },
        ) { message ->
            MessageRow(
                message = message,
                onClick = { onMessageClick(message) },
            )
        }
    }
}
```

The mapping is:

- vertical `LinearLayoutManager` → `LazyColumn`
- horizontal `LinearLayoutManager` → `LazyRow`
- `ViewHolder` row → an item Composable
- adapter data updates → state-driven list updates
- stable item identity → `key`
- `RecyclerView` padding/gaps → `contentPadding`/`Arrangement.spacedBy`

Add headers or other fixed content with `item { ... }`. If the adapter contains a legacy/custom View that cannot yet be migrated, wrap that View with `AndroidView`; do not recreate it in the `update` block. Add a `@Preview`, compare with the existing XML screen, and run `./gradlew build` after integration.

Files in this skill

  • eval-1.baseline.md1.8 KB
  • eval-1.with-skill.md1.9 KB
  • eval-2.baseline.md1.8 KB
  • eval-2.with-skill.md1.9 KB
  • eval-3.baseline.md1.5 KB
  • eval-3.with-skill.md1.5 KB
  • trigger-1.md82 B
  • trigger-2.md115 B
  • trigger-3.md111 B
  • trigger-4.md113 B
  • trigger-5.md100 B
  • trigger-6.md104 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.