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....
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill android-compose-migration --agent claude-codeInstalls 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 automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-android-compose-migration-17b635e8)More formats (shields.io, HTML) on the badges page.
# 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.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!