Conversation
There was a problem hiding this comment.
Pull request overview
This PR targets an Android crash related to ViewPager2/RecyclerView “scrapped” (recycled) views by improving cleanup behavior during view recycling and teardown, and updates example dependency lockfiles to reflect the current package/pod versions.
Changes:
- Update
ViewPagerAdapterto better handle recycling by removing container children on recycle/failure-to-recycle and by detaching views from their parents more safely. - Add
onDropViewInstancecleanup to stop internal scrolling and detach the underlying RecyclerView adapter when the native view is dropped. - Refresh lockfiles (CocoaPods + Bun) in the repo and example app.
Reviewed changes
Copilot reviewed 2 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| example/ios/Podfile.lock | Updates resolved pod versions/checksums for the example iOS app. |
| example/bun.lockb | Updates Bun dependency lock for the example app. |
| bun.lockb | Updates Bun dependency lock at the repo root. |
| android/src/main/java/com/reactnativepagerview/ViewPagerAdapter.kt | Adjusts page view attach/detach and adds recycling cleanup hooks. |
| android/src/main/java/com/reactnativepagerview/PagerViewViewManager.kt | Adds teardown cleanup on view drop for the internal RecyclerView/ViewPager2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
android/src/main/java/com/reactnativepagerview/PagerViewViewManager.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativepagerview/ViewPagerAdapter.kt
Outdated
Show resolved
Hide resolved
49106df to
6d07957
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 9 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
android/src/main/java/com/reactnativepagerview/PagerViewViewManager.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativepagerview/PagerViewViewManager.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativepagerview/SafeLinearLayoutManager.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativepagerview/PagerViewViewManager.kt
Outdated
Show resolved
Hide resolved
6d07957 to
2c4ea72
Compare
|
@MrRefactor When will be this merged? |
when I will finish testing it |
Summary
Test Plan
What's required for testing (prerequisites)?
What are the steps to reproduce (after prerequisites)?
Compatibility
Checklist
README.md