FlowLayout
FlowLayout copied to clipboard
Center Justify
Would love to see a center justified option for this FlowLayout! I'd create a pull request, but just don't have the time right now.
I'll try to take a look into that over the weekend. Maybe I'll add some sort of weight system similar to stock android LinearLayout, and than you could achieve this by setting same weight to al child view. Although this may be a bit of an overkill. :smile:
@blazsolar No I was thinking the same thing really, either that or when the new line is created, add the children to a LinearLayout and center that within the FlowLayout. I think technically both would work?
Yea, they would both work, but if you add LinearLayout to it you have one extra level in your layout hierarchy which is bad for for performance reasons.
Hey @blazsolar, so I actually was already using the flow layout from "ApmeM" and realized it was a fairly easy process to create a center justification setting, so I sent him a pull request which you can find here. https://github.com/ApmeM/android-flowlayout/pull/23 I'm not quite sure how both of your libraries differ (Minus the fact I couldn't get it to pull down from Maven for some reason) but maybe that can help you with the justification! Let me know if I can help in anyway.
Hey @blazsolar here is another newer library which is doing it using weights: https://github.com/suanmiao/flowlayout
because this issue I decided to make https://github.com/ahmadmuzakki29/justify-layout. automatically wrap to new line, and re-arrange child to justified.