Skip to content

Commit 764f286

Browse files
authored
Merge pull request #528 from dohooo/develop
Develop
2 parents dc92612 + b654f43 commit 764f286

File tree

37 files changed

+101
-113
lines changed

37 files changed

+101
-113
lines changed

.changeset/proud-bobcats-tan.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-reanimated-carousel': patch
3+
---
4+
5+
Exported TAnimationStyle types.

.changeset/slow-donkeys-rest.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-reanimated-carousel': patch
3+
---
4+
5+
Replaced 'onScrollBegin' with 'onScrollStart' to better match gesture callback.

example/app/src/pages/advanced-parallax/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import Animated, {
55
interpolateColor,
66
useAnimatedStyle,
77
} from "react-native-reanimated";
8-
import Carousel from "react-native-reanimated-carousel";
8+
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";
99

10-
import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
1110
import { SBItem } from "../../components/SBItem";
1211
import SButton from "../../components/SButton";
1312
import { ElementsText, window } from "../../constants";

example/app/src/pages/circular/index.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import * as React from "react";
22
import { Text, View } from "react-native";
33
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
44
import { interpolate } from "react-native-reanimated";
5-
import Carousel from "react-native-reanimated-carousel";
5+
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";
66

77
import { faker } from "@faker-js/faker";
88

9-
import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
109
import { SBImageItem } from "../../components/SBImageItem";
1110
import SButton from "../../components/SButton";
1211
import { ElementsText, window } from "../../constants";
@@ -30,9 +29,9 @@ function Index() {
3029
);
3130

3231
const translateX
33-
= interpolate(value, [-1, 0, 1], [-itemSize, 0, itemSize])
34-
+ centerOffset
35-
- itemGap;
32+
= interpolate(value, [-1, 0, 1], [-itemSize, 0, itemSize])
33+
+ centerOffset
34+
- itemGap;
3635

3736
const translateY = interpolate(
3837
value,
@@ -109,8 +108,8 @@ function Index() {
109108
fontSize: 40,
110109
}}
111110
>
112-
{faker.name
113-
.findName()
111+
{faker.person.
112+
fullName()
114113
.slice(0, 2)
115114
.toUpperCase()}
116115
</Text>

example/app/src/pages/cube-3d/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import Animated, {
66
interpolateColor,
77
useAnimatedStyle,
88
} from "react-native-reanimated";
9-
import Carousel from "react-native-reanimated-carousel";
9+
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";
1010

11-
import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
1211
import { SBItem } from "../../components/SBItem";
1312
import { window } from "../../constants";
1413
import { withAnchorPoint } from "../../utils/anchor-point";

example/app/src/pages/flow/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import * as React from "react";
22
import { Text, View, Image } from "react-native";
33
import { interpolate } from "react-native-reanimated";
4-
import Carousel from "react-native-reanimated-carousel";
4+
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";
55

66
import { faker } from "@faker-js/faker";
77
import { BlurView } from "expo-blur";
88

9-
import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
109
import { window } from "../../constants";
1110

1211
function Index() {

example/app/src/pages/fold/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import { StyleSheet, Text, View } from "react-native";
33
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
44
import type Animated from "react-native-reanimated";
55
import { Extrapolate, interpolate } from "react-native-reanimated";
6-
import Carousel from "react-native-reanimated-carousel";
6+
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";
77

88
import { faker } from "@faker-js/faker";
99

10-
import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
1110
import { SBImageItem } from "../../components/SBImageItem";
1211
import SButton from "../../components/SButton";
1312
import { ElementsText, window } from "../../constants";
@@ -154,7 +153,7 @@ const Item: React.FC<{
154153
textAlign: "center",
155154
}}
156155
>
157-
{faker.name.findName().slice(0, 2).toUpperCase()}
156+
{faker.name.fullName().slice(0, 2).toUpperCase()}
158157
</Text>
159158
</View>
160159
</TouchableWithoutFeedback>

example/app/src/pages/normal/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ function Index() {
4747
autoPlay={isAutoPlay}
4848
autoPlayInterval={isFast ? 100 : 2000}
4949
data={data}
50+
onScrollStart={()=>{console.log('===1')}}
51+
onScrollEnd={()=>{console.log('===2')}}
52+
5053
onConfigurePanGesture={g => g.enabled(false)}
5154
pagingEnabled={isPagingEnabled}
5255
onSnapToItem={index => console.log("current index:", index)}

example/app/src/pages/pause-advanced-parallax/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import Animated, {
55
interpolateColor,
66
useAnimatedStyle,
77
} from "react-native-reanimated";
8-
import Carousel from "react-native-reanimated-carousel";
8+
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";
99

10-
import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
1110
import { SBItem } from "../../components/SBItem";
1211
import SButton from "../../components/SButton";
1312
import { ElementsText, window } from "../../constants";

example/app/src/pages/press-swipe/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import Animated, {
77
useSharedValue,
88
withTiming,
99
} from "react-native-reanimated";
10-
import Carousel from "react-native-reanimated-carousel";
10+
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";
1111

12-
import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
1312
import SButton from "../../components/SButton";
1413
import { ElementsText, window } from "../../constants";
1514
import { ImageItems } from "../../utils/items";
@@ -46,7 +45,7 @@ function Index() {
4645
style={{ width: PAGE_WIDTH, height: 240 }}
4746
width={PAGE_WIDTH}
4847
data={[...ImageItems, ...ImageItems]}
49-
onScrollBegin={() => {
48+
onScrollStart={() => {
5049
pressAnim.value = withTiming(1);
5150
}}
5251
onScrollEnd={() => {

0 commit comments

Comments
 (0)