Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/proud-bobcats-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-reanimated-carousel': patch
---

Exported TAnimationStyle types.
5 changes: 5 additions & 0 deletions .changeset/slow-donkeys-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-native-reanimated-carousel': patch
---

Replaced 'onScrollBegin' with 'onScrollStart' to better match gesture callback.
3 changes: 1 addition & 2 deletions example/app/src/pages/advanced-parallax/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import Animated, {
interpolateColor,
useAnimatedStyle,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
Expand Down
13 changes: 6 additions & 7 deletions example/app/src/pages/circular/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import * as React from "react";
import { Text, View } from "react-native";
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

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

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

const translateX
= interpolate(value, [-1, 0, 1], [-itemSize, 0, itemSize])
+ centerOffset
- itemGap;
= interpolate(value, [-1, 0, 1], [-itemSize, 0, itemSize])
+ centerOffset
- itemGap;

const translateY = interpolate(
value,
Expand Down Expand Up @@ -109,8 +108,8 @@ function Index() {
fontSize: 40,
}}
>
{faker.name
.findName()
{faker.person.
fullName()
.slice(0, 2)
.toUpperCase()}
</Text>
Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/cube-3d/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import Animated, {
interpolateColor,
useAnimatedStyle,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import { window } from "../../constants";
import { withAnchorPoint } from "../../utils/anchor-point";
Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/flow/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as React from "react";
import { Text, View, Image } from "react-native";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

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

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { window } from "../../constants";

function Index() {
Expand Down
5 changes: 2 additions & 3 deletions example/app/src/pages/fold/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { StyleSheet, Text, View } from "react-native";
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
import type Animated from "react-native-reanimated";
import { Extrapolate, interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

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

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBImageItem } from "../../components/SBImageItem";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
Expand Down Expand Up @@ -154,7 +153,7 @@ const Item: React.FC<{
textAlign: "center",
}}
>
{faker.name.findName().slice(0, 2).toUpperCase()}
{faker.name.fullName().slice(0, 2).toUpperCase()}
</Text>
</View>
</TouchableWithoutFeedback>
Expand Down
3 changes: 3 additions & 0 deletions example/app/src/pages/normal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ function Index() {
autoPlay={isAutoPlay}
autoPlayInterval={isFast ? 100 : 2000}
data={data}
onScrollStart={()=>{console.log('===1')}}
onScrollEnd={()=>{console.log('===2')}}

onConfigurePanGesture={g => g.enabled(false)}
pagingEnabled={isPagingEnabled}
onSnapToItem={index => console.log("current index:", index)}
Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/pause-advanced-parallax/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import Animated, {
interpolateColor,
useAnimatedStyle,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
Expand Down
5 changes: 2 additions & 3 deletions example/app/src/pages/press-swipe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import Animated, {
useSharedValue,
withTiming,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
import { ImageItems } from "../../utils/items";
Expand Down Expand Up @@ -46,7 +45,7 @@ function Index() {
style={{ width: PAGE_WIDTH, height: 240 }}
width={PAGE_WIDTH}
data={[...ImageItems, ...ImageItems]}
onScrollBegin={() => {
onScrollStart={() => {
pressAnim.value = withTiming(1);
}}
onScrollEnd={() => {
Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/rotate-in-out/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from "react";
import { View } from "react-native";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import { ElementsText, window } from "../../constants";
import { useToggleButton } from "../../hooks/useToggleButton";
Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/rotate-scale-fade-in-out/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from "react";
import { View } from "react-native";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import { ElementsText, window } from "../../constants";
import { useToggleButton } from "../../hooks/useToggleButton";
Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/scale-fade-in-out/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from "react";
import { View } from "react-native";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import { window } from "../../constants";

Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/stack-cards/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import Animated, {
useAnimatedStyle,
useSharedValue,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import { Arrow, ArrowDirection } from "./Arrow";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { window } from "../../constants";

function Index() {
Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/tear/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import Animated, {
interpolate,
useAnimatedStyle,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
import { ImageItems } from "../../utils/items";
Expand Down
3 changes: 1 addition & 2 deletions example/app/src/pages/tinder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import Animated, {
interpolate,
useSharedValue,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import { window } from "../../constants";
import { getImages } from "../../utils/get-images";
import { TAnimationStyle } from "../../../../../src/components/BaseLayout";

const data = getImages()

Expand Down
3 changes: 1 addition & 2 deletions example/website/pages/Examples/advanced-parallax.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ import Animated, {
interpolateColor,
useAnimatedStyle,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
Expand Down
13 changes: 6 additions & 7 deletions example/website/pages/Examples/circular.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ import * as React from "react";
import { Text, View } from "react-native";
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

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

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBImageItem } from "../../components/SBImageItem";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
Expand All @@ -72,9 +71,9 @@ function Index() {
);

const translateX
= interpolate(value, [-1, 0, 1], [-itemSize, 0, itemSize])
+ centerOffset
- itemGap;
= interpolate(value, [-1, 0, 1], [-itemSize, 0, itemSize])
+ centerOffset
- itemGap;

const translateY = interpolate(
value,
Expand Down Expand Up @@ -151,8 +150,8 @@ function Index() {
fontSize: 40,
}}
>
{faker.name
.findName()
{faker.person.
fullName()
.slice(0, 2)
.toUpperCase()}
</Text>
Expand Down
3 changes: 1 addition & 2 deletions example/website/pages/Examples/cube-3d.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ import Animated, {
interpolateColor,
useAnimatedStyle,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import { window } from "../../constants";
import { withAnchorPoint } from "../../utils/anchor-point";
Expand Down
3 changes: 1 addition & 2 deletions example/website/pages/Examples/flow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ import Page from '../../components/Page'
import * as React from "react";
import { Text, View, Image } from "react-native";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

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

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { window } from "../../constants";

function Index() {
Expand Down
5 changes: 2 additions & 3 deletions example/website/pages/Examples/fold.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ import { StyleSheet, Text, View } from "react-native";
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
import type Animated from "react-native-reanimated";
import { Extrapolate, interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

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

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBImageItem } from "../../components/SBImageItem";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
Expand Down Expand Up @@ -196,7 +195,7 @@ const Item: React.FC<{
textAlign: "center",
}}
>
{faker.name.findName().slice(0, 2).toUpperCase()}
{faker.name.fullName().slice(0, 2).toUpperCase()}
</Text>
</View>
</TouchableWithoutFeedback>
Expand Down
3 changes: 1 addition & 2 deletions example/website/pages/Examples/pause-advanced-parallax.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ import Animated, {
interpolateColor,
useAnimatedStyle,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
Expand Down
5 changes: 2 additions & 3 deletions example/website/pages/Examples/press-swipe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ import Animated, {
useSharedValue,
withTiming,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import SButton from "../../components/SButton";
import { ElementsText, window } from "../../constants";
import { ImageItems } from "../../utils/items";
Expand Down Expand Up @@ -88,7 +87,7 @@ function Index() {
style={{ width: PAGE_WIDTH, height: 240 }}
width={PAGE_WIDTH}
data={[...ImageItems, ...ImageItems]}
onScrollBegin={() => {
onScrollStart={() => {
pressAnim.value = withTiming(1);
}}
onScrollEnd={() => {
Expand Down
3 changes: 1 addition & 2 deletions example/website/pages/Examples/rotate-in-out.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ import Page from '../../components/Page'
import * as React from "react";
import { View } from "react-native";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import { ElementsText, window } from "../../constants";
import { useToggleButton } from "../../hooks/useToggleButton";
Expand Down
3 changes: 1 addition & 2 deletions example/website/pages/Examples/rotate-scale-fade-in-out.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ import Page from '../../components/Page'
import * as React from "react";
import { View } from "react-native";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import { ElementsText, window } from "../../constants";
import { useToggleButton } from "../../hooks/useToggleButton";
Expand Down
3 changes: 1 addition & 2 deletions example/website/pages/Examples/scale-fade-in-out.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ import Page from '../../components/Page'
import * as React from "react";
import { View } from "react-native";
import { interpolate } from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { SBItem } from "../../components/SBItem";
import { window } from "../../constants";

Expand Down
3 changes: 1 addition & 2 deletions example/website/pages/Examples/stack-cards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ import Animated, {
useAnimatedStyle,
useSharedValue,
} from "react-native-reanimated";
import Carousel from "react-native-reanimated-carousel";
import Carousel, { TAnimationStyle } from "react-native-reanimated-carousel";

import { Arrow, ArrowDirection } from "./Arrow";

import type { TAnimationStyle } from "../../../../src/layouts/BaseLayout";
import { window } from "../../constants";

function Index() {
Expand Down
Loading