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

Support horizontal scrolling with FlexDirection.ROW #215

Closed
saket opened this issue Feb 28, 2017 · 13 comments
Closed

Support horizontal scrolling with FlexDirection.ROW #215

saket opened this issue Feb 28, 2017 · 13 comments
Milestone

Comments

@saket
Copy link

saket commented Feb 28, 2017

Hello, thanks for this fantastic library. I'm trying to create a horizontally scrollable list, but FlexboxLayoutManager doesn't seem to be wrapping the list items. In each column, all items have the same width, which doesn't look correct. Is there something I'm missing? I'm using this code:

FlexboxLayoutManager flexboxLayoutManager = new FlexboxLayoutManager();
flexboxLayoutManager.setFlexWrap(FlexWrap.WRAP);
flexboxLayoutManager.setFlexDirection(FlexDirection.COLUMN);

Update: Oh wait, supplying setAlignItems() with something other than STRETCH fixes the width of the items. As in, they're no longer equi sized. So I've realized that I want the items to be laid out in row fashion, but the list should be horizontally scrollable. Is this possible?

@thagikura
Copy link
Contributor

Hi @Saketme,

Currently horizontal scrolling is not supported if you set the flex direction as FlexDirection.ROW (or ROW_REVERSE).

But it could be implemented in the future, could you change the title as something like "Support horizontal scrolling with FlexDirection.ROW"?

@saket saket changed the title How do I make FlexboxLayoutManager work with FlexDirection.COLUMN? Support horizontal scrolling with FlexDirection.ROW Mar 1, 2017
@saket
Copy link
Author

saket commented Mar 1, 2017

Done :)

@thagikura
Copy link
Contributor

Thanks. I'll keep this as an enhancement.

@AnninaO
Copy link

AnninaO commented Apr 25, 2017

Hi @thagikura !
I am looking for the same functionality, trying to make my FlexboxLayout wider than the actual screen and then make it scrollable. As this is not supported I tried to achieve it by wrapping it in a HorizontalScrollView, but unfortunately if I do that the wrapping doesn't work anymore. Is there any workaround how I can make the vertical scrolling possible for my FlexboxLayout?

@thagikura
Copy link
Contributor

Hi @AnninaO,

At this moment, you can't scroll a RecyclerView with FlexboxLayoutManager in both directions.

@thagikura
Copy link
Contributor

Fixed by #315

@thagikura thagikura added this to the 0.3.0 milestone Jun 26, 2017
@MarioHBS
Copy link

Hello, the problem persists, when I put the FlexboxLayout (ROW mode) inside a HorizontalScrollView the items contract

@AbdoulMDiscovery
Copy link

Hello, the problem persists, when I put the FlexboxLayout (ROW mode) inside a HorizontalScrollView the items contract

@MarioHBS were you able to resolve the issue? I am facing the same issue

@shahzadafridi
Copy link

This issue still exits.

@sheinin
Copy link

sheinin commented Nov 16, 2021

Hello, the problem persists, when I put the FlexboxLayout (ROW mode) inside a HorizontalScrollView the items contract

@MarioHBS were you able to resolve the issue? I am facing the same issue

Having the same issue

@bharat1320
Copy link

Guys I have found a solution, simply use ChipGroup instead of FlexBox , literally everything works fine as expected

@Okuro3499
Copy link

Okuro3499 commented Sep 29, 2023

is there a fix for this issue? experienced this after upgrading my from
implementation 'com.google.android:flexbox:1.0.0'
to
implementation 'com.google.android.flexbox:flexbox:3.0.0'
and now items are now squeezed to fit screen which does not look good
Screenshot 2023-09-29 14 46 53
expected behavior is to display as shown in myteams and be scrollable horizontally

this is link to my xml https://github.com/open-learning-exchange/myplanet/blob/master/app/src/main/res/layout/home_card_library.xml

@shahaashit26
Copy link

Any solution to this ?

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

No branches or pull requests

10 participants