Skip to content

Commit 9a55282

Browse files
committed
feat(next): remove fabric example
1 parent 1138d97 commit 9a55282

File tree

118 files changed

+29
-12657
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

+29
-12657
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: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ This library supports both architectures (Paper and Fabric). If you would like e
3030

3131
`yarn add react-native-pager-view@newarch`
3232

33-
3433
## Migration
3534

3635
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).
@@ -43,27 +42,30 @@ In version **6.x** support for `transitionStyle` property has been dropped. More
4342

4443
## New architecture setup (Fabric)
4544

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.
45+
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.
46+
4747
### iOS
48-
Install pods with this flag inside `ios` folder:
48+
49+
Install pods with this flag inside `ios` folder:
50+
4951
```sh
5052
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+
```
5354

5455
### Android
55-
Set `newArchEnabled` to `true` inside `android/gradle.properties` (this flag is already set to true in `fabricexample`) and then run:
56+
57+
Set `newArchEnabled` to `true` inside `android/gradle.properties` and then run:
58+
5659
```sh
5760
yarn android
5861
```
5962

60-
If you have issues with running android build you can try to generate codegen before the build using this command:
63+
If you have issues with running android build you can try to generate codegen before the build using this command:
6164

6265
```sh
6366
cd android && ./gradlew generateCodegenArtifactsFromSchema
6467
```
6568

66-
6769
## Linking
6870

6971
### >= 0.60
@@ -179,8 +181,8 @@ For advanced usage please take a look into our [example project](https://github.
179181
| `orientation: Orientation` | Set `horizontal` or `vertical` scrolling orientation (it does **not** work dynamically) | both |
180182
| `overScrollMode: OverScollMode` | Used to override default value of overScroll mode. Can be `auto`, `always` or `never`. Defaults to `auto` | Android |
181183
| `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 |
184+
| `overdrag: boolean` | Allows for overscrolling after reaching the end or very beginning or pages. Defaults to `false` | iOS |
185+
| `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 |
184186

185187
| Method | Description | Platform |
186188
| ------------------------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------: |
@@ -212,7 +214,7 @@ requestAnimationFrame(() => refPagerView.current?.setPage(index));
212214

213215
### iOS
214216

215-
| horizontal | vertical |
217+
| horizontal | vertical |
216218
| :------------------------------------------------------------------: | :--------------------------------------------------------------------: |
217219
| <img src="img/ios-viewpager-scroll.gif" alt="ViewPager" width="325"> | <img src="img/ios-viewpager-vertical.gif" alt="ViewPager" width="325"> |
218220

@@ -227,37 +229,38 @@ To attach reanimated handler with `onPageScroll` follow the below steps.
227229
```jsx
228230
// 1. Define the handler
229231
function usePageScrollHandler(handlers, dependencies) {
230-
const {context, doDependenciesDiffer} = useHandler(handlers, dependencies);
232+
const { context, doDependenciesDiffer } = useHandler(handlers, dependencies);
231233
const subscribeForEvents = ['onPageScroll'];
232234

233235
return useEvent(
234-
event => {
236+
(event) => {
235237
'worklet';
236-
const {onPageScroll} = handlers;
238+
const { onPageScroll } = handlers;
237239
if (onPageScroll && event.eventName.endsWith('onPageScroll')) {
238240
onPageScroll(event, context);
239241
}
240242
},
241243
subscribeForEvents,
242-
doDependenciesDiffer,
244+
doDependenciesDiffer
243245
);
244246
}
245-
247+
246248
// 2. Attach the event handler
247-
import PagerView from "react-native-pager-view";
248-
import Animated from "react-native-reanimated";
249+
import PagerView from 'react-native-pager-view';
250+
import Animated from 'react-native-reanimated';
249251
const AnimatedPagerView = Animated.createAnimatedComponent(PagerView);
250252

251253
const pageScrollHandler = usePageScrollHandler({
252-
onPageScroll: e => {
253-
'worklet';
254-
offset.value = e.offset;
255-
console.log(e.offset, e.position);
256-
},
254+
onPageScroll: (e) => {
255+
'worklet';
256+
offset.value = e.offset;
257+
console.log(e.offset, e.position);
258+
},
257259
});
258260

259-
<AnimatedPagerView onPageScroll={pageScrollHandler}/>
261+
<AnimatedPagerView onPageScroll={pageScrollHandler} />;
260262
```
263+
261264
## License
262265

263266
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)