I'm trying to create a recycler view with this type of layout. The items are strings and can apear with diferent sizes, i dont know how much items there will be in each row. Can I do this with a StaggeredGridLayoutManager? The image is just a fake example, there can be more items in each row

You might wanna check out the open-source FlexboxLayout, developed by Google, especially FlexboxLayoutManager which is a layout manager for a RecyclerView.
To create the layout manager with the right config, just do this:
FlexboxLayoutManager layoutManager = new FlexboxLayoutManager();
layoutManager.setFlexWrap(FlexWrap.WRAP);
For more information, check out the Android Developers Blog's post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With