-
Notifications
You must be signed in to change notification settings - Fork 422
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(android): Allow pages to be removed #351
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
troZee
requested changes
May 12, 2021
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.
hey @mrbrentkelly , thank you for a fix. I have added a few comments to your PR.
android/src/main/java/com/reactnativepagerview/PagerViewViewManager.kt
Outdated
Show resolved
Hide resolved
troZee
added a commit
that referenced
this pull request
Jun 10, 2021
* fix(js): handle the component unmounting (#340) * Fixes #339 - Handle the component unmounting If the component unmounts immediately after mounting, then the call to requestAnimationFrame will attempt to operate on the unmounted component. We can prevent this by ensuring we cleanup the callback on unmounting. * Default value to undefined, rather than 0 * chore: update lib folder * Release 5.1.6 * fix(js): add missing `onStartShouldSetResponder` function (#342) * chore: update lib folder * Release 5.1.7 * Update README.md (#346) * Update README.md Added import statement on "Manual Linking on Android" section. * Update README.md Use PagerViewPackage instead of RNCPagerViewPackage while manually linking on android. * chore(deps): bump hosted-git-info from 2.8.8 to 2.8.9 in /example (#350) Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](npm/hosted-git-info@v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(android): Allow pages to be removed (#351) * fix(android): Allow pages to be removed * chore: Address CR comments * chore: update lib folder * Release 5.1.8 * fix(ios): Changing swipe direction flickers (#330) (#356) * Release 5.1.9 * chore: bump an example * chore(deps): bump browserslist from 4.16.3 to 4.16.6 (#361) Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.3 to 4.16.6. - [Release notes](https://github.com/browserslist/browserslist/releases) - [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md) - [Commits](browserslist/browserslist@4.16.3...4.16.6) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump browserslist from 4.16.3 to 4.16.6 in /example (#362) Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.3 to 4.16.6. - [Release notes](https://github.com/browserslist/browserslist/releases) - [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md) - [Commits](browserslist/browserslist@4.16.3...4.16.6) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(ios): offset is changing while overDrag is disabled (#363) * Release 5.1.10 * chore(android): remove build tools version (#365) * chore: update the lib folder * Release 5.1.11 * feat(ios): BREAKING CHANGE - change default value of overDrag prop to false (#364) * fix(ios): offset is changing while overDrag is disabled * feat: change overDrag to be false by default * chore: lib * Release 5.2.0 Co-authored-by: Ian Wright <[email protected]> Co-authored-by: Piotr Trocki <[email protected]> Co-authored-by: Mickael Lecoq <[email protected]> Co-authored-by: Niraj Niroula <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brent Kelly <[email protected]> Co-authored-by: Piotr Trocki <[email protected]> Co-authored-by: Danijel Bojcic <[email protected]> Co-authored-by: Dulmandakh <[email protected]>
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #349
Removing a page on Android was resulting in a white screen until you interacted with the ViewPager. The issue appears to be related to this historical React Native issue facebook/react-native#17968 where by custom Android native UI modules don't re-layout correctly on certain occasions. I introduced the workaround as outlined here facebook/react-native#17968 (comment) to refresh the pager when a page is removed.
Before
After
Test Plan
What's required for testing (prerequisites)?
Create a pager with 3 pages and run on an Android device.
What are the steps to reproduce (after prerequisites)?
Delete the 2nd page.
See #349 for steps to reproduce original issue.
Compatibility
Checklist
I added the documentation inREADME.md
I updated the typed files (TS and Flow)