Skip to content

Masonry layout manager and provider - #526

Open
dwidc wants to merge 2 commits into
Flipkart:masterfrom
dwidc:masonry
Open

Masonry layout manager and provider#526
dwidc wants to merge 2 commits into
Flipkart:masterfrom
dwidc:masonry

Conversation

@dwidc

@dwidc dwidc commented Jul 15, 2020

Copy link
Copy Markdown

Added staggered grid / masonry layout.
I made this as #175 has no follow-ups.

Currently only support vertical orientation, horizontal layout is not yet implemented.

@fzp0723

fzp0723 commented Aug 18, 2020

Copy link
Copy Markdown

I use it by copy it to my code, but it work little strangely when load more data, it overlap the pre data.

@fzp0723

fzp0723 commented Aug 18, 2020

Copy link
Copy Markdown

@dwidc I find the reason. When call dataProvider.cloneWithRows method and not set firstModifiedIndex param, your relayoutFromIndex method will go wrong because the startIndex is not zero.

@dwidc

dwidc commented Aug 27, 2020

Copy link
Copy Markdown
Author

@Paul0523
Can you elaborate more? Maybe with some sample codes?

I never set firstModifiedIndex when calling dataProvider.cloneWithRows(), and relayoutFromIndex() works just fine.
If I remember correctly, relayoutFromIndex() can be called multiple times, and its startIndex param could be > 0.

@mshafex

mshafex commented Jan 14, 2021

Copy link
Copy Markdown

how to include this pr to my react native project
please help

@Mattesackboy

Copy link
Copy Markdown

Please merge/add masonry layout to this library! It would be the best thing ever 'cause there are no libraries that support infinite scroll + recycling + masonry!
See also this: #175
@naqvitalha @muskeinsingh

@lclrobert2020

lclrobert2020 commented Oct 19, 2021

Copy link
Copy Markdown

when using with infinite scroll, picture can't be added?
also, when using this grid, onEndReached will trigger twice?

@lclrobert2020

lclrobert2020 commented Oct 19, 2021

Copy link
Copy Markdown

when using with infinite scroll, picture can't be added? also, when using this grid, onEndReached will trigger twice?

Bug found,
it seems that the creator forget that array starts from 0, so that the algo can't add new items after the first time,
as it always finding the item with index+1

@chj-damon

Copy link
Copy Markdown

@dwidc any updates on this PR? also, can you provide us a demo to show How to use this new provider? Thank you very much!

@chj-damon

Copy link
Copy Markdown

@lclrobert2020 any update?

@lclrobert2020

lclrobert2020 commented Jan 13, 2022

Copy link
Copy Markdown

@lclrobert2020 any update?

I made it work a few months ago, but I forget where did I put my code,
I will update a working example asap

@chj-damon

Copy link
Copy Markdown

@lclrobert2020 Thank you so much!

@lclrobert2020

lclrobert2020 commented Jan 14, 2022

Copy link
Copy Markdown

@lclrobert2020 Thank you so much!

https://snack.expo.dev/@robertli93/grid_example

this is my expo snack

I have uploaded a working masonrylayoutmanager to the npm but I didn't have time to write readme,

this masonrylayoutmanager is a fixed version of other people's work ( sorry i forget who and where is the original)

so credit should also give to them

there are some minor problems with the snack e.g. using UNSAFE_componentWillMount, I will write a better one if I had time

@sviat-barbutsa

Copy link
Copy Markdown

Thanks for sharing. Btw, does it support the responsive layout? I mean: on the screen-width resize how to change & redraw the item columns?

@mohity777

Copy link
Copy Markdown

Why is it not merged yet ??

@zyestin

zyestin commented Mar 1, 2024

Copy link
Copy Markdown

MasonryFlashList will meet your needs

Use High performance mode, have a look at Shopify/flash-list#946 (comment)

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

Successfully merging this pull request may close these issues.

10 participants