Android FlowLayout as RecyclerView LayoutManager

Happo picture Happo · Jul 1, 2016 · Viewed 10.5k times · Source

I want to implement a Tag Cloud with Android Chips.

enter image description here

But i think the best way to do this is with a RecycleView and a custom LayoutManager. I search for a LayoutManager which layout its children like a FlowLayout but found nothing.

Has someone found this kind of behavior or a good and simple tutorial about custom layout managers? I found no simple or simple but incomplete articles.

enter image description here.

Answer

Glacoon picture Glacoon · Aug 3, 2016

I found a library that does this.

You have add this line to your Gradle depencencies:

compile 'com.xiaofeng.android:flowlayoutmanager:1.2.3.2'

and set your recycler view layout manager with it:

recyclerView.setLayoutManager(new FlowLayoutManager());

You have additional details on how to configure it on Github: https://github.com/xiaofeng-han/AndroidLibs/tree/master/flowlayoutmanager