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

Add support for FlexboxLayoutManager #716

Open
1 task done
mnayef95 opened this issue Oct 17, 2020 · 3 comments
Open
1 task done

Add support for FlexboxLayoutManager #716

mnayef95 opened this issue Oct 17, 2020 · 3 comments

Comments

@mnayef95
Copy link

mnayef95 commented Oct 17, 2020

It's will be nice to support https://github.com/google/flexbox-layout, is there a way to use it now without official support?

@nicous
Copy link
Contributor

nicous commented Nov 5, 2020

Hey @mnayef95 , Litho uses https://yogalayout.com/ to build the UI. Not sure if I understand how would you want to use flexbox here, can you give an example?

@mnayef95
Copy link
Author

mnayef95 commented Nov 5, 2020

@nicous Now I can use something like this

GridRecyclerConfiguration.create()
            .numColumns(3)
            .gridLayoutInfoFactory { c, _, _, _, _ ->
                GridLayoutInfo(GridLayoutManager(c, 3))
            }
            .build()

But I can't use something like this:

FlexboxRecyclerConfiguration.create()
            .flexboxLayoutInfoFactory { c, _, _, _, _ ->
                FlexboxLayoutInfo(FlexboxLayoutManager(c))
            }
            .build()

So I can use them like this:

val component = RecyclerCollectionComponent.create(componentContext)
                .section(ExampleSection.create(SectionContext(componentContext)).build())
                .recyclerConfiguration(Grid | Flexbox | Linear | etc...)
                .build()

@nicous
Copy link
Contributor

nicous commented Apr 6, 2021

Hey @mnayef95, sorry for the delay on this, tbh I did not see your response until now. As you said we don't have that but I think you can probably implement this by creating a configuration for it and the layout info factory.

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