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

fix(android): Allow pages to be removed #351

Merged
merged 2 commits into from
May 13, 2021
Merged

Conversation

mrbrentkelly
Copy link
Contributor

@mrbrentkelly mrbrentkelly commented May 12, 2021

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

OS Implemented
iOS ❌ (N/A)
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)

Copy link
Member

@troZee troZee left a 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.

@troZee troZee merged commit 944ccb4 into callstack:master May 13, 2021
@troZee
Copy link
Member

troZee commented May 13, 2021

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]>
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.

Removing a page not working on Android
2 participants