FlowLayout icon indicating copy to clipboard operation
FlowLayout copied to clipboard

Ignore right/end padding of last child in a line

Open RyanRamchandar opened this issue 10 years ago • 8 comments

Ignoring the right/end padding of the last child can allow more children to fit on a line.

A workaround for now is to reduce the right/end padding of the FlowLayout to offset the child right/end padding.

device-2015-03-09-165230

RyanRamchandar avatar Mar 09 '15 21:03 RyanRamchandar

Similarly, the bottom padding of the children in the last row can be ignored.

RyanRamchandar avatar Mar 10 '15 21:03 RyanRamchandar

I'll try to look into this in next couple of week. Thanks for raising the issue.

blazsolar avatar Mar 13 '15 21:03 blazsolar

is that a good idea?.. if we remove right margin of the last child in row (6th one) and add one more child(7th one) right to that .. there will not be any margin between 6th and 7th. now the last child is 7th and there should be a margin between 6th and 7th according to the above design.. but there is no space..

riyase avatar May 20 '15 08:05 riyase

So what should happen is that we should try to add 7th item to the row without margin. If it fits in we leave it there and we leave margin of 6th item in. If 7th item without margin does not fit in the row it should be added to next row as 1st item with margin included.

blazsolar avatar May 20 '15 09:05 blazsolar

@blazsolar Yes this is correct.

RyanRamchandar avatar May 21 '15 15:05 RyanRamchandar

I would suggest that the children's margins ought to be respected. It's generally a bad idea for a layout manager to remove/ignore properties of the views it is managing. What's really wanted here are a couple of properties on the FlowLayout - horizontal spacing & vertical spacing.

vaughandroid avatar Jul 16 '15 14:07 vaughandroid

@vaughandroid yes I agree with this approach.

RyanRamchandar avatar Jul 16 '15 19:07 RyanRamchandar

@blazsolar any updates on this?

RyanRamchandar avatar Jul 06 '17 23:07 RyanRamchandar