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

Implement inverted prop. #25

Merged
merged 4 commits into from
Aug 2, 2018
Merged

Implement inverted prop. #25

merged 4 commits into from
Aug 2, 2018

Conversation

arendjr
Copy link
Contributor

@arendjr arendjr commented Jul 30, 2018

This PR implements the inverted prop. Its purpose is simply to revert the scoll direction (ie. the first item will be rendered at the bottom). The name and purpose of the prop are the same as the inverted prop for React Native's own FlatList component. The implementation simply uses Android's setReverseLayout() method.

Hope you find this useful!

@godness84
Copy link
Owner

Thanks @arendjr, but there's a problem with header and footer. In the current implementation they are put inside the body of RecyclerViewItem when the item is the first (header) or the last element (footer). When the list is inverted, header and footer are misplaced.

It's not the best implementation, for example when you swap the first and second items the header is animated with the second item, instead of being fixed at the top. Anyway it works.

I have a fix ready, it switches header and footer placing them in the right position when passed to RecyclerViewItem.

How can I commit it on your branch? Or should I create a new branch on my side?

Or you prefer to fix the entire implementation of header and footer placing them not inside the body of RecyclerViewItem?

@arendjr
Copy link
Contributor Author

arendjr commented Aug 1, 2018

Oh, great! My use-case didn't involve headers or footers, so I hadn't noticed that one yet. But I see you already managed to push to the branch, thanks! As far as I'm concerned, it's good to go 👍

@godness84 godness84 merged commit 7060df2 into godness84:master Aug 2, 2018
@godness84
Copy link
Owner

New v0.3.4 release!

@arendjr
Copy link
Contributor Author

arendjr commented Aug 3, 2018

Thanks!

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.

3 participants