Skip to content

Commit 48730f4

Browse files
authored
refactor(lib): Remove experimental useNext implementation (#918)
* refactor(lib): Remove experimental Next implementation * chore(lib): Fix lint * Rev fixes
1 parent 1e03beb commit 48730f4

28 files changed

+750
-1685
lines changed

android/src/fabric/java/com/reactnativepagerview/LEGACY_PagerViewViewManager.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.

android/src/fabric/java/com/reactnativepagerview/PagerViewViewManager.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,6 @@ class PagerViewViewManager : ViewGroupManager<NestedScrollableHost>(), RNCViewPa
173173
return
174174
}
175175

176-
@ReactProp(name = "useLegacy")
177-
override fun setUseLegacy(view: NestedScrollableHost?, value: Boolean) {
178-
return
179-
}
180-
181176
fun goTo(root: NestedScrollableHost?, selectedPage: Int, scrollWithAnimation: Boolean) {
182177
if (root == null) {
183178
return

android/src/main/java/com/reactnativepagerview/LEGACY_PagerViewViewManagerImpl.kt

Lines changed: 0 additions & 7 deletions
This file was deleted.

android/src/main/java/com/reactnativepagerview/PagerViewViewPackage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ class PagerViewPackage : ReactPackage {
1212
}
1313

1414
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
15-
return listOf(PagerViewViewManager(), LEGACY_PagerViewViewManager())
15+
return listOf(PagerViewViewManager())
1616
}
1717
}

android/src/paper/java/com/reactnativepagerview/LEGACY_PagerViewViewManager.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.

example/src/App.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import {
1111
Button,
1212
Alert,
1313
I18nManager,
14-
DevSettings,
15-
Platform,
14+
DevSettings
1615
} from 'react-native';
1716
import { NavigationContainer, useNavigation } from '@react-navigation/native';
1817
import { createStackNavigator } from '@react-navigation/stack';
@@ -34,7 +33,6 @@ import CoverflowExample from './tabView/CoverflowExample';
3433
import ReanimatedOnPageScrollExample from './ReanimatedOnPageScrollExample';
3534
import { createNativeStackNavigator } from '@react-navigation/native-stack';
3635
import { SafeAreaProvider } from 'react-native-safe-area-context';
37-
import { NextBasicPagerViewExample } from './NextBasicPagerViewExample';
3836
import { PagerHookExample } from './PagerHookExample';
3937

4038
const examples = [
@@ -69,13 +67,6 @@ const examples = [
6967
{ component: CoverflowExample, name: 'CoverflowExample' },
7068
];
7169

72-
if (Platform.OS === 'ios') {
73-
examples.unshift({
74-
component: NextBasicPagerViewExample,
75-
name: '🔜 Next Basic Example',
76-
});
77-
}
78-
7970
function App() {
8071
const navigation = useNavigation();
8172
return (

example/src/NextBasicPagerViewExample.tsx

Lines changed: 0 additions & 70 deletions
This file was deleted.

example/src/ScrollablePagerViewExample.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export function ScrollablePagerViewExample() {
2828
{...navigationPanel}
2929
testID={'pager-view'}
3030
ref={ref}
31-
// todo fix it
32-
useLegacy
3331
style={{ height: HEIGHT }}
3432
>
3533
{navigationPanel.pages.map((page) => (

ios/Fabric/RNCPagerViewComponentView.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@
44
#import <Foundation/Foundation.h>
55
#import <React/RCTViewComponentView.h>
66
#import "UIViewController+CreateExtension.h"
7+
#import "UIView+isHorizontalRtlLayout.h"
78

89
NS_ASSUME_NONNULL_BEGIN
910

10-
@interface RNCPagerViewComponentView : RCTViewComponentView <UIScrollViewDelegate>
11+
@interface RNCPagerViewComponentView : RCTViewComponentView <UIPageViewControllerDataSource, UIPageViewControllerDelegate, UIScrollViewDelegate, RtlLayoutProtocol>
12+
13+
@property(strong, nonatomic, readonly) UIPageViewController *nativePageViewController;
14+
@property(nonatomic, strong) NSMutableArray<UIViewController *> *nativeChildrenViewControllers;
15+
@property(nonatomic) NSInteger initialPage;
16+
@property(nonatomic) NSInteger currentIndex;
17+
@property(nonatomic) NSInteger destinationIndex;
18+
@property(nonatomic) NSString* layoutDirection;
19+
@property(nonatomic) BOOL overdrag;
1120

1221
- (void)setPage:(NSInteger)number;
1322
- (void)setPageWithoutAnimation:(NSInteger)number;

0 commit comments

Comments
 (0)