Skip to content

Commit a4a49fb

Browse files
committed
remove all legacy swipeable references
1 parent fb3110f commit a4a49fb

File tree

9 files changed

+1
-1024
lines changed

9 files changed

+1
-1024
lines changed

Swipeable/package.json

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

example/App.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import TwoFingerPan from './src/release_tests/twoFingerPan';
4343
import { PinchableBox } from './src/recipes/scaleAndRotate';
4444
import PanAndScroll from './src/recipes/panAndScroll';
4545
import { BottomSheet } from './src/showcase/bottomSheet';
46-
import Swipeables from './src/showcase/swipeable';
4746
import ChatHeads from './src/showcase/chatHeads';
4847
import Draggable from './src/basic/draggable';
4948
import MultiTap from './src/basic/multitap';
@@ -157,7 +156,6 @@ const EXAMPLES: ExamplesSection[] = [
157156
sectionTitle: 'Showcase',
158157
data: [
159158
{ name: 'Bottom sheet', component: BottomSheet },
160-
{ name: 'Swipeables', component: Swipeables },
161159
{ name: 'Chat heads', component: ChatHeads },
162160
],
163161
},

example/src/release_tests/swipeableReanimation/index.tsx

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import React, { useRef } from 'react';
2-
import { Text, Animated, StyleSheet, View } from 'react-native';
2+
import { Text, StyleSheet, View } from 'react-native';
33

44
import {
5-
Swipeable,
65
GestureHandlerRootView,
76
Pressable,
87
} from 'react-native-gesture-handler';
@@ -48,55 +47,8 @@ function RightAction(prog: SharedValue<number>, drag: SharedValue<number>) {
4847
);
4948
}
5049

51-
function LegacyLeftAction(prog: any, drag: any) {
52-
prog.addListener((value: any) => {
53-
console.log('[L] showLeftProgress:', value.value);
54-
});
55-
drag.addListener((value: any) => {
56-
console.log('[L] appliedTranslation:', value.value);
57-
});
58-
59-
const trans = Animated.subtract(drag, 50);
60-
61-
return (
62-
<Animated.Text
63-
style={[
64-
styles.leftAction,
65-
{
66-
transform: [{ translateX: trans }],
67-
},
68-
]}>
69-
Text
70-
</Animated.Text>
71-
);
72-
}
73-
74-
function LegacyRightAction(prog: any, drag: any) {
75-
prog.addListener((value: any) => {
76-
console.log('[L] showRightProgress:', value.value);
77-
});
78-
drag.addListener((value: any) => {
79-
console.log('[L] appliedTranslation:', value.value);
80-
});
81-
82-
const trans = Animated.add(drag, 50);
83-
84-
return (
85-
<Animated.Text
86-
style={[
87-
styles.rightAction,
88-
{
89-
transform: [{ translateX: trans }],
90-
},
91-
]}>
92-
Text
93-
</Animated.Text>
94-
);
95-
}
96-
9750
export default function Example() {
9851
const reanimatedRef = useRef<SwipeableMethods>(null);
99-
const legacyRef = useRef<Swipeable>(null);
10052

10153
return (
10254
<GestureHandlerRootView>
@@ -109,31 +61,27 @@ export default function Example() {
10961
style={styles.control}
11062
onPress={() => {
11163
reanimatedRef.current!.openLeft();
112-
legacyRef.current?.openLeft();
11364
}}>
11465
<Text>open left</Text>
11566
</Pressable>
11667
<Pressable
11768
style={styles.control}
11869
onPress={() => {
11970
reanimatedRef.current!.close();
120-
legacyRef.current!.close();
12171
}}>
12272
<Text>close</Text>
12373
</Pressable>
12474
<Pressable
12575
style={styles.control}
12676
onPress={() => {
12777
reanimatedRef.current!.reset();
128-
legacyRef.current!.reset();
12978
}}>
13079
<Text>reset</Text>
13180
</Pressable>
13281
<Pressable
13382
style={styles.control}
13483
onPress={() => {
13584
reanimatedRef.current!.openRight();
136-
legacyRef.current!.openRight();
13785
}}>
13886
<Text>open right</Text>
13987
</Pressable>
@@ -155,20 +103,6 @@ export default function Example() {
155103
</ReanimatedSwipeable>
156104

157105
<View style={styles.separator} />
158-
159-
<Swipeable
160-
ref={legacyRef}
161-
containerStyle={styles.swipeable}
162-
friction={2}
163-
leftThreshold={80}
164-
enableTrackpadTwoFingerGesture
165-
rightThreshold={40}
166-
renderLeftActions={LegacyLeftAction}
167-
renderRightActions={LegacyRightAction}>
168-
<Text>[Legacy] Swipe me!</Text>
169-
</Swipeable>
170-
171-
<View style={styles.separator} />
172106
</GestureHandlerRootView>
173107
);
174108
}

example/src/showcase/swipeable/AppleStyleSwipeableRow.tsx

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

example/src/showcase/swipeable/GmailStyleSwipeableRow.tsx

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

0 commit comments

Comments
 (0)