Problem have this UI problem:
1) I have 3 textViews which I want to hold in one parent view.
2) I want to populate as many items as possible in as few lines as possible.
3) Only between 2 items there is a separator.
Suggested algorithm:
Get the container's widthGet each item unspecified width (For that I have to create a custom textView to override onMeasure()).
Calculate and keep aside "last line remaining width".
If next textView can fit in the last line remaining width:
- make the last separator visible
- put it in the same line and move to next textView item
else:
- open a new line with
remaining width = (container's width - current item's width) - make the last separator invisible
- put the current item in that line (break lines if needed)
I have two options:
- To use a vertical linear layout of horizontal linear layouts.
- To use a constraint layout.
I would fill a List of Lists and will populate the horizontal linear layouts via code.
Or fill the constraint layout via code (less generic and I guess more difficult).
Is there any simpler solution?

If I'm understanding your requirements correctly, I believe the FlexboxLayout library from Google should do exactly what you want.
You'd probably use a
FlexboxLayout(rather than aRecyclerViewwith aFlexboxLayoutManager), but it is good to note that this library also supports recycling.