Skip to content

Commit 3ea6dae

Browse files
authored
Merge pull request #778 from callstack/feat/remove-fabricexample
feat(next): remove fabric example
2 parents 1138d97 + 9c0796a commit 3ea6dae

File tree

118 files changed

+19
-12679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+19
-12679
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ test-butler-app.apk
5858
example/vendor
5959

6060
#Example
61-
fabricexample/ios/Pods
62-
fabricexample/vendor
63-
fabricexample/android/app/.cxx
6461
.lefthookrc
6562
lefthook.yml
6663

@@ -72,4 +69,3 @@ lefthook.yml
7269
#Testing
7370
/coverage
7471
example/coverage
75-
fabricexample/coverage

README.md

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ This component allows the user to swipe left and right through pages of data. Un
2424
| iOS | iOS support |
2525
| ViewPager1 | ViewPager2 |
2626

27-
## New architecture support (Fabric)
28-
29-
This library supports both architectures (Paper and Fabric). If you would like enable new architecture, please run below command:
30-
31-
`yarn add react-native-pager-view@newarch`
32-
33-
3427
## Migration
3528

3629
In version **6.x** support for `transitionStyle` property has been dropped. More information [here](https://github.com/callstack/react-native-pager-view/blob/master/MIGRATION.md).
@@ -41,29 +34,6 @@ In version **6.x** support for `transitionStyle` property has been dropped. More
4134

4235
`yarn add react-native-pager-view`
4336

44-
## New architecture setup (Fabric)
45-
46-
This library supports new architecture! We have two example folders one for each architecture. If you are using this library in your own project there some extra steps needed.
47-
### iOS
48-
Install pods with this flag inside `ios` folder:
49-
```sh
50-
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
51-
```
52-
(Inside of `fabricexample` the `RCT_NEW_ARCH_ENABLED` is already set to true by default inside `Podfile`)
53-
54-
### Android
55-
Set `newArchEnabled` to `true` inside `android/gradle.properties` (this flag is already set to true in `fabricexample`) and then run:
56-
```sh
57-
yarn android
58-
```
59-
60-
If you have issues with running android build you can try to generate codegen before the build using this command:
61-
62-
```sh
63-
cd android && ./gradlew generateCodegenArtifactsFromSchema
64-
```
65-
66-
6737
## Linking
6838

6939
### >= 0.60
@@ -179,8 +149,8 @@ For advanced usage please take a look into our [example project](https://github.
179149
| `orientation: Orientation` | Set `horizontal` or `vertical` scrolling orientation (it does **not** work dynamically) | both |
180150
| `overScrollMode: OverScollMode` | Used to override default value of overScroll mode. Can be `auto`, `always` or `never`. Defaults to `auto` | Android |
181151
| `offscreenPageLimit: number` | Set the number of pages that should be retained to either side of the currently visible page(s). Pages beyond this limit will be recreated from the adapter when needed. Defaults to RecyclerView's caching strategy. The given value must either be larger than 0. | Android |
182-
| `overdrag: boolean` | Allows for overscrolling after reaching the end or very beginning or pages. Defaults to `false` | iOS |
183-
| `layoutDirection: ('ltr' / 'rtl' / 'locale')` | Specifies layout direction. Use `ltr` or `rtl` to set explicitly or `locale` to deduce from the default language script of a locale. Defaults to `locale` | both |
152+
| `overdrag: boolean` | Allows for overscrolling after reaching the end or very beginning or pages. Defaults to `false` | iOS |
153+
| `layoutDirection: ('ltr' / 'rtl' / 'locale')` | Specifies layout direction. Use `ltr` or `rtl` to set explicitly or `locale` to deduce from the default language script of a locale. Defaults to `locale` | both |
184154

185155
| Method | Description | Platform |
186156
| ------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------: |
@@ -212,7 +182,7 @@ requestAnimationFrame(() => refPagerView.current?.setPage(index));
212182

213183
### iOS
214184

215-
| horizontal | vertical |
185+
| horizontal | vertical |
216186
| :------------------------------------------------------------------: | :--------------------------------------------------------------------: |
217187
| <img src="img/ios-viewpager-scroll.gif" alt="ViewPager" width="325"> | <img src="img/ios-viewpager-vertical.gif" alt="ViewPager" width="325"> |
218188

@@ -227,37 +197,38 @@ To attach reanimated handler with `onPageScroll` follow the below steps.
227197
```jsx
228198
// 1. Define the handler
229199
function usePageScrollHandler(handlers, dependencies) {
230-
const {context, doDependenciesDiffer} = useHandler(handlers, dependencies);
200+
const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);
231201
const subscribeForEvents = ['onPageScroll'];
232202

233203
return useEvent(
234-
event => {
204+
(event) => {
235205
'worklet';
236-
const {onPageScroll} = handlers;
206+
const { onPageScroll } = handlers;
237207
if (onPageScroll && event.eventName.endsWith('onPageScroll')) {
238208
onPageScroll(event, context);
239209
}
240210
},
241211
subscribeForEvents,
242-
doDependenciesDiffer,
212+
doDependenciesDiffer
243213
);
244214
}
245-
215+
246216
// 2. Attach the event handler
247-
import PagerView from "react-native-pager-view";
248-
import Animated from "react-native-reanimated";
217+
import PagerView from 'react-native-pager-view';
218+
import Animated from 'react-native-reanimated';
249219
const AnimatedPagerView = Animated.createAnimatedComponent(PagerView);
250220

251221
const pageScrollHandler = usePageScrollHandler({
252-
onPageScroll: e => {
253-
'worklet';
254-
offset.value = e.offset;
255-
console.log(e.offset, e.position);
256-
},
222+
onPageScroll: (e) => {
223+
'worklet';
224+
offset.value = e.offset;
225+
console.log(e.offset, e.position);
226+
},
257227
});
258228

259-
<AnimatedPagerView onPageScroll={pageScrollHandler}/>
229+
<AnimatedPagerView onPageScroll={pageScrollHandler} />;
260230
```
231+
261232
## License
262233

263234
MIT

fabricexample/.buckconfig

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

fabricexample/.bundle/config

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

fabricexample/.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

fabricexample/.watchmanconfig

Lines changed: 0 additions & 1 deletion
This file was deleted.

fabricexample/Gemfile

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

fabricexample/Gemfile.lock

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

fabricexample/__tests__/App-test.tsx

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

fabricexample/_node-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)