Skip to content

Commit

Permalink
Merge branch 'master' into feat/old-new-arch-example
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	README.md
  • Loading branch information
Piotr Trocki committed Aug 29, 2023
2 parents f019bd7 + 25aa3fc commit b9e2988
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ example/vendor
#Example
example/ios/Pods
example/vendor
example/android/app/.cxx
.lefthookrc
lefthook.yml


# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
example/android/app/.cxx

# testing
/coverage
/coverage
.cxx
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@ This component allows the user to swipe left and right through pages of data. Un

## Versions

| 4.x | 5.x |
| ---------- | ----------- |
| iOS | iOS support |
| ViewPager1 | ViewPager2 |

## New architecture support (Fabric)

This library supports both architectures (Paper and Fabric). If you would like enable new architecture, please run below command:

`yarn add react-native-pager-view@newarch`
| 4.x | 5.x and above |
| ---------- | ------------- |
| iOS | iOS support |
| ViewPager1 | ViewPager2 |

## Migration

Expand Down
4 changes: 4 additions & 0 deletions ios/Fabric/RNCPagerViewComponentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ - (void)enableSwipe {
- (void)goTo:(NSInteger)index animated:(BOOL)animated {
NSInteger numberOfPages = _nativeChildrenViewControllers.count;

if (index == _currentIndex) {
return;
}

[self disableSwipe];

_destinationIndex = index;
Expand Down
4 changes: 4 additions & 0 deletions ios/ReactNativePageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ - (void)enableSwipe {
- (void)goTo:(NSInteger)index animated:(BOOL)animated {
NSInteger numberOfPages = self.reactSubviews.count;

if (index == _currentIndex) {
return;
}

[self disableSwipe];

_destinationIndex = index;
Expand Down
2 changes: 1 addition & 1 deletion ios/ReactViewPagerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ - (void) changeScrollEnabled
[self goToPage:reactTag index:index animated:false];
}

RCT_EXPORT_METHOD(setScrollEnabled
RCT_EXPORT_METHOD(setScrollEnabledImperatively
: (nonnull NSNumber *)reactTag enabled
: (nonnull NSNumber *)enabled) {
BOOL isEnabled = [enabled boolValue];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-pager-view",
"version": "6.2.0",
"version": "6.2.1",
"description": "React Native wrapper for Android and iOS ViewPager",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down

0 comments on commit b9e2988

Please sign in to comment.