ApmeM/android-flowlayout — pull request #18 by AndreasMattsson (2014-05-13 11:59:42+00:00)
Title: Added support for filling lines that wrap, using weight, gravity and fill

Introduced a view attribute "fillLines" to allow FlowLayout to distribute left over space of a line that has wrapped among the child views of that line.

If "fillLines" is left at "none" (which is the default) FlowLayout will behave as normal, otherwise child views will receive left over space according their respective "weight" (works as in LinearLayout).

How each child view uses that extra space is determined by its "layout_gravity" (or the "gravity" of the parent FlowLayout); either it will be aligned within that space or stretched (with "fill_horizontal" or "fill_vertical") across that space.

This added feature was added with things such as toolbars in mind, where you may wish to be able to wrap views as needed but don't want any wasted space when wrapping; you could for example have a TextView for "search" fill up remaining space.

Just as with LinearLayout, deep child view hierarchies should be avoided when "fillLines" is enabled, as when active child views must be remeasured in a second pass in order to support the "weight" attribute.

![device-2014-05-13-135723](https://cloud.githubusercontent.com/assets/689840/2956768/d8afa0ae-da95-11e3-9f15-d3b3ae2e6f7b.png)