callstack / react-native-pager-view

React Native wrapper for the Android ViewPager and iOS UIPageViewController.
MIT License
2.74k stars 419 forks source link

Roadmap #233

Closed troZee closed 3 years ago

troZee commented 4 years ago

Revert stable version of ViewPager on Android (version v4.2.0) (@troZee)

In the 4.x.x version, native implementation of ViewPager has been updated to a higher version, which is V2. V2 version uses another implementation (Recycler View) than V1. Community noticed lots of issues in the V2 version, hence I would like to revert viewpager to V1 and create a separate branch for V2.

action items:

Create a separate workspaces for lib and example: (no version affected) (@troZee )

Each library repository should provide an example of library usage. This example should cover a common use cases. In the ViewPager example, I would like to add some dependencies like react-navigation, to be able to test ViewPager with other libs.

Example of separate workspaces: https://github.com/react-native-community/react-native-slider/commit/5220303629b2c570c02c3f4c51b4b9ebea5da24c

action items:

Add more examples: (no version affected)

People use VP in various cases. Currently the library provides only one simple case, hence it is hard to reproduce some issues.

Example cases: VP inside FlatList FlatList inside VP more and more

If you would like to add an example to lib, don't hesitate and please reach me out in this ticket.

Add known issues section to README file (no version affected) (everyone can take it)

Known issues:

[iOS]: In case of UIViewControllerHierarchyInconsistency error, please use below fix:

requestAnimationFrame(() => refViewPager.current?.setPage(index));

E2E tests: (no version affected) (optional)

This library is purely native. JS part is only responsible for exposing view and methods, which can be used inside React components. I would like to cover some cases, which I did for each PR (swiping between each page, deleting each page)

mqtik commented 4 years ago

Is there an onLoaded function?

yodaheis commented 4 years ago

Any ETA on this? Also which is the most stable version as far as Android is concerned?

troZee commented 4 years ago

Any ETA on this? Also which is the most stable version as far as Android is concerned?

It is hard to say about ETA. I will try to revert android to the stable one in this week. I will put an update here.

troZee commented 4 years ago

@yodaheis FYI: The ViewPager has been reverted to a stable version in 4.2

troZee commented 3 years ago

All of those things has been resolved, hence I close this issue.

fukemy commented 2 years ago

i still got error

 Assertion failure in -[UIPageViewController queuingScrollView:willManuallyScroll:toRevealView:concealView:animated:], UIPageViewController.m:1966
2022-08-26 19:32:28.000980+0700 VedaxLink[15191:14589608] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpected view controller: <UIViewController: 0x175b84ff0>'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000109dbbd70 __exceptionPreprocess + 236
    1   libobjc.A.dylib                     0x00000001068a214c objc_exception_throw + 56
    2   Foundation                          0x000000010ace7560 _userInfoForFileAndLine + 0
    3   UIKitCore                           0x00000001263c10c8 -[UIPageViewController queuingScrollView:willManuallyScroll:toRevealView:concealView:animated:] + 964
    4   UIKitCore                           0x00000001263cd764 -[_UIQueuingScrollView _notifyDelegateWillManuallyScroll:toRevealView:concealingView:animated:] + 132
    5   UIKitCore                           0x00000001263ceaf4 __54-[_UIQueuingScrollView _didScrollWithAnimation:force:]_block_invoke + 452
    6   UIKitCore                           0x00000001263ce72c -[_UIQueuingScrollView _didScrollWithAnimation:force:] + 604
    7   UIKitCore                           0x00000001263cac34 -[_UIQueuingScrollView layoutSubviews] + 188
    8   UIKitCore                           0x0000000127124434 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2588
    9   QuartzCore                          0x000000010b9148ec _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 472
    10  QuartzCore                          0x000000010b91f6f0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 116
    11  QuartzCore                          0x000000010b85853c _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 448
    12  QuartzCore                          0x000000010b884554 _ZN2CA11Transaction6commitEv + 696
    13  QuartzCore                          0x000000010b8857ac _ZN2CA11Transaction25flush_as_runloop_observerEb + 68
    14  CoreFoundation                      0x0000000109d28f10 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
    15  CoreFoundation                      0x0000000109d235a4 __CFRunLoopDoObservers + 572
    16  CoreFoundation                      0x0000000109d23af8 __CFRunLoopRun + 968
    17  CoreFoundation                      0x0000000109d23218 CFRunLoopRunSpecific + 572
    18  GraphicsServices                    0x0000000112bab60c GSEventRunModal + 160
    19  UIKitCore                           0x0000000126bb5a98 -[UIApplication _run] + 992
    20  UIKitCore                           0x0000000126bba634 UIApplicationMain + 112
    21  VedaxLink                           0x0000000104788290 main + 80
    22  dyld                                0x0000000106275cd8 start_sim + 20
    23  ???                                 0x00000001061c508c 0x0 + 4397486220
    24  ???                                 0x6f21800000000000 0x0 + 8007822349929807872
)