import { Text, StyleSheet, View, Pressable, Button } from 'react-native';
import { useRef } from 'react';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import ReanimatedSwipeable from 'react-native-gesture-handler/ReanimatedSwipeable';
import Reanimated, { useAnimatedStyle } from 'react-native-reanimated';
function RightAction(prog, drag) {
const styleAnimation = useAnimatedStyle(() => {
console.log('showRightProgress:', prog.value);
console.log('appliedTranslation:', drag.value);
return {
transform: [{ translateX: drag.value + 50 }],
};
});
return (
{
console.log('delete this item');
}}
>
Icon
);
}
export default function Swiping() {
const reanimatedRef = useRef();
return (
Swipe me!
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'stretch',
justifyContent: 'center',
},
rightAction: {
width: 50,
height: 50,
padding: 5,
backgroundColor: 'gold',
color: 'black',
},
separator: {
width: '100%',
borderTopWidth: 1,
},
txt: { color: 'white', paddingBlock: 10 },
swipeable: {
height: 50,
backgroundColor: 'rebeccapurple',
color: 'white',
alignItems: 'center',
},
});