Skip to content

Instantly share code, notes, and snippets.

@chenzhang2006
Last active August 12, 2022 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chenzhang2006/b2814e1596608f5d0201aecfdf7aca5f to your computer and use it in GitHub Desktop.
Save chenzhang2006/b2814e1596608f5d0201aecfdf7aca5f to your computer and use it in GitHub Desktop.
Compose Row & Column Share Same LazyListState
val items: List<Room> = rooms
val listState = rememberLazyListState()
// Horizontal List
LazyRow(state = listState) {
items(items = items) { item -> RoomItem(item) }
}
// Vertical List
LazyColumn(state = listState) {
items(items = items) { item -> RoomItem(item) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment