Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Children still laid out even when outside flMaxRows #44

Closed
lwasyl opened this issue Dec 1, 2020 · 3 comments
Closed

Children still laid out even when outside flMaxRows #44

lwasyl opened this issue Dec 1, 2020 · 3 comments

Comments

@lwasyl
Copy link

lwasyl commented Dec 1, 2020

With the following setup:

<com.nex3z.flowlayout.FlowLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:flChildSpacing="4dp"
    app:flMaxRows="1"
    app:flRowSpacing="4dp"
    ><!-- children --> </com.nex3z.flowlayout.FlowLayout>

when the children would normally extend to second and further rows, then even though only the first row is drawn, the second row is still laid out and extends outside the FlowLayout. That is, FlowLayout's height is only big enough to fit the first row, but the second row items still appear in the hierarchy outside of that area. This is usually not an issue, unless the parent layout declares clipChildren="false" somwhere, in which case the second row will start rendering and probably overlapping some other views.

Here with the above setup I have the FlowLayout bounds highlighted:
image

as you can see, some children are laid out outside of it:
image

@nex3z
Copy link
Owner

nex3z commented Dec 2, 2020

I've made a fix in 1.3.2:

implementation 'com.nex3z:flow-layout:1.3.2'

layout

@lwasyl
Copy link
Author

lwasyl commented Dec 2, 2020

That was quick, thank you :) I confirm the issue is fixed in 1.3.2 🎉

@lwasyl lwasyl closed this as completed Dec 2, 2020
@lwasyl
Copy link
Author

lwasyl commented Dec 11, 2020

(For tracking purposes) be aware that fix for this in 1.3.2 broke another scenario described in #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants