Sunday, 15 July 2018

Staggered layout with FlexboxLayoutManager

I there any way to implement a staggered layout using google's Flexbox library similar to this
Layout implemented using StaggeredLayoutManager
The above layout is created using StaggeredLayoutManger also maintaining the aspect ratio of the image
I have tried the code:
recyclerView.apply {
        layoutManager = FlexboxLayoutManager(context).apply {
            flexWrap = FlexWrap.WRAP
            justifyContent = JustifyContent.CENTER
        }
        adapter = mAdapter
    }

But it's making the layout with single column and aspect ratio is also not maintained(Considering that images are of large size).


from Staggered layout with FlexboxLayoutManager

No comments:

Post a Comment