Search code examples
androidandroid-recyclerviewandroid-gridlayout

Recycler view with auto span count and item width with wrap content


I have a RecyclerView with a GridLayoutManger. I want to use dynamic span count depend on item width.

I don't want fixed item width.

example


Solution

  • You can use FlexboxLayoutManager from google:

    enter image description here

    https://github.com/google/flexbox-layout