Search code examples
androidandroid-jetpack-compose

RecyclerView LayoutManager functionality in LazyColumn or LazyRow?


How to get Recyclerview LayoutManager functionality in Jetpack compose?

LazyColumn{
    items(items.itemCount){

    }
}

Solution

  • LinearLayoutManager

    LazyColumn or LazyRow
    

    GridLayoutManager

    LazyVerticalGrid or LazyHorizontalGrid
    

    StaggeredGridLayoutManager

    LazyVerticalStaggeredGrid or LazyHorizontalStaggeredGrid
    

    you can set like this|

    LazyColumn(Modifier.fillMaxSize()) {
        items(data) {
            ListItem(it)
        }
    }