-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Fix Viewpager on Android when using native navigation. #14867
Conversation
cc @achen1 |
@javache Any chance of getting this reviewing this? |
@ruiaraujo this doesn't seem to fix my issue while using React Native Navigation. The issue is the same though. The viewpager loses the layout. |
@ruiaraujo I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
@facebook-github-bot label Needs more information Generated by 🚫 dangerJS |
@andrerfneves how did you test this? |
@ruiaraujo I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
@satya164 Test Plan:
|
The fix does not seems to solve the problem of dynamic adding a page to ViewPager, code sample below:
|
@bood Why does this PR need to fix your unrelated problem? This fix is about:
|
That's embarrassing if it is not related at all. |
My understanding of that issue is that it only talks about losing smooth scrolling after detach and reattach. |
@satya164 Do you need anything else to get this merged? |
@danilobuerger I'll test it when I get time. holidays just got over |
@danilobuerger Thanks for following through, I have changed topic quite dramatically so it was hard for me to provide a test plan easily. |
@satya164 I am frustrated. It has been 3 weeks since I made the test plan for you. When I posted:
You immediately jumped in and objected:
A few days later you had your test plan. You have everything you need. Was it just a trick? Did you just want me to get off your back? Do you really not care? If so, please tell me if there is somebody else that is willing to take a look at this and get it merged. |
@danilobuerger that's a shitty way to treat maintainers. listen, I contribute to React Native in my free time. and I haven't gotten the time to test the PR. even PRs on my own repos haven't been reviewed. it's been only 14 days. chill out, and maybe have some empathy for other people. |
@satya164 it has been 21 days, not 14 days. Why do you think it was 14 days ago when I submitted the test plan? I do have empathy, that's why I am asking if you know of anybody else who can get it merged as you clearly don't have time to do it. And personally, I don't think my attitude towards you is "shitty", I just want to get things done. Rather what you are doing has a really chilling effect on new contributors. You are scaring them away, they are putting hard work into the PR, they are really trying and then they just get the cold shoulder. Why should anybody new contribute, if they get the feeling that things won't get merged? |
@danilobuerger @satya164 is but a contributor to the repo. He takes his free time to try and move the technology forward. He's not paid for it. It can take 1 day, 14 days, 21 days, or 6 months, it doesn't matter. If you'd like to complain about the RN open source repository as a whole, including how PRs are getting merged (or not), complain to Facebook directly. I understand your frustration, dealt with a lot of this myself in the past. But it's the nature of open source software, especially really large packages/ecosystems like RN. |
@danilobuerger I understand your frustration because I also have an open PR on this repo that's just a single line change and it's been open for more than 40 days. I also agree that this push away new contributions. But I understand how open source works so I try not to be hard on maintainers. What I recommend for you is what I do on these situations: use a fork or, better, use the awesome patch-package to apply your fixes without a fork. |
@brunolemos Thanks for the tip. However, how would you use patch-package in that case? I guess you would have to always recompile from source since you can't use the aar? |
If you can find this file inside node_modules, it will work. Just edit it with this PR changes and follow the instructions in the patch package readme. |
@brunolemos I just tried it out and as I thought, it doesn't work as the build process uses the aar and not the source. |
Never tried this but if you edit the aar patch package might be able to patch it. |
cc @hramos tested and works fine. can we get this merged? |
@ruiaraujo please rebase and I can look into getting this imported. Thanks! |
e32824a
to
33f825d
Compare
@hramos done! |
@facebook-github-bot label Needs more information @facebook-github-bot label Needs more information Generated by 🚫 dangerJS |
Something went wrong executing that command, @mkonicek could you take a look? |
@hramos friendly ping! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: See the "broken" video attached to really understand the problem easily. On Android after navigating to any other screen using wix navigation library, the native viewpager would lose the settling page behaviour which is quite annoying for the users. This is caused by the onAttachedToWindow that resets mFirstLayout to true inside ViewPager. By request another layout pass, everything works as expected. Working video is the application with patched RN. [broken.mp4](https://github.com/facebook/react-native/files/1128028/broken.mp4.zip) [working.mp4](https://github.com/facebook/react-native/files/1128032/working.mp4.zip) Closes facebook/react-native#14867 Differential Revision: D7154981 Pulled By: hramos fbshipit-source-id: 2b3570800a5320ed2c12c488748d9e1358936c84
Summary: See the "broken" video attached to really understand the problem easily. On Android after navigating to any other screen using wix navigation library, the native viewpager would lose the settling page behaviour which is quite annoying for the users. This is caused by the onAttachedToWindow that resets mFirstLayout to true inside ViewPager. By request another layout pass, everything works as expected. Working video is the application with patched RN. [broken.mp4](https://github.com/facebook/react-native/files/1128028/broken.mp4.zip) [working.mp4](https://github.com/facebook/react-native/files/1128032/working.mp4.zip) Closes facebook/react-native#14867 Differential Revision: D7154981 Pulled By: hramos fbshipit-source-id: 2b3570800a5320ed2c12c488748d9e1358936c84
See the "broken" video attached to really understand the problem easily.
On Android after navigating to any other screen using wix navigation library, the native viewpager would lose the settling page behaviour which is quite annoying for the users.
This is caused by the onAttachedToWindow that resets mFirstLayout to true inside ViewPager. By request another layout pass, everything works as expected.
Working video is the application with patched RN.
broken.mp4
working.mp4