Gravity issues
The layout_gravity="right" and layout_gravity="left" (or start/end) don't work for children of a FlowLayout.
This FlowLayout just supports horizontal flow layout, so it doesn't make sense that the children of a horizontal FlowLayout use "start/left" or "end/right" layout_gravity.
It does make sense when in the flowlayout there are three items, and the third doesn't fit in the row, but there's still some space left. By supporting gravity, this space wouldn't always be at the end of the second item but maybe in the middle or at the start of the first one.
oh, I get your point now. It's really userful in some situations. But It's a little complicated to layout all children if the attr layout_gravity = "left/right" is supported in each child of a FlowLayout. Maybe it is more reasonable to support the attr layout_gravity = "left/right" for each row rather than each child?
The whole point of the FlowLayout is that the rows and in which row the elements are positioned are determined dynamically, so I don't see how it could be useful (or implemented) to have this feature. You don't know/control, how many rows there are, which elements are in which row, etc. You could do something like
if(flowLayout.getRows().size() > 1 && flowLayout.getRows().get(1).contains(elementX){ flowLayout.getRows().get(1).setGravity(Gravity.RIGHT); }
but this would be complicated to implement and make it nessecary to modify the FlowLayout in-code to achive the wanted effect. At the moment, you can do anything you want just using XML.
yeah, I agree with your idea. You can hava a look at the FlexBoxLayout library provided by Google recently. Maybe it can help you.