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

Is it possible to have a wrapped FlexboxLayout "pin" the overflow rather than be the same height as the rest of the view #523

Open
1 task done
adziki opened this issue Dec 9, 2019 · 0 comments

Comments

@adziki
Copy link

adziki commented Dec 9, 2019

Issues and steps to reproduce

Not sure if this is possible, I have a RecyclerView with a FlexboxLayoutManager, each view in the RecyclerView is a CardView which has a FlexboxLayout which contains a set of TextViews. The TextViews can extend past the bottom of the screen, causing the FlexboxLayout to wrap to another column (great, expected behavior)

FlexboxLayerManager config:

flexboxLayoutManager = FlexboxLayoutManager(baseContext)
flexboxLayoutManager.setFlexDirection(FlexDirection.COLUMN)
flexboxLayoutManager.setFlexWrap(FlexWrap.WRAP)
flexboxLayoutManager.setJustifyContent(JustifyContent.FLEX_START)

When the layout wraps, the two columns have the same height, which can lead to lots of wasted space. I'm wondering if there's a setting or where I would look to be able to have the second column "pin" to the height of its content, rather than matching the first column height.

Screen Shot 2019-12-08 at 5 51 41 PM

(the lighter gray background is the parent CardView, the darker gray backgrounds are LinearLayouts (wrapping both Item with its Sub-items), those LinearLayouts are added to the CardView's FlexboxLayout.

Expected behavior (hopeful behavior)

Screen Shot 2019-12-08 at 6 20 30 PM

It obviously looks tough because the CardView needs to be a rectangle, but I'm hoping to be able to trim down the empty whitespace so things can fit under it like so:
Screen Shot 2019-12-08 at 6 20 30 PM

Version of the flexbox library

2.0.0

Link to code

https://github.com/adziki/flexbox-layout-sample

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

1 participant