-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
35 lines (32 loc) · 745 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, {
useMemo,
} from 'react';
import {
PanGestureHandler,
} from 'react-native-gesture-handler';
import {
Animated,
} from 'react-native';
import { RNCamera } from 'react-native-camera';
export default () => {
const dragX = useMemo(() => new Animated.Value(0), []);
const onGestureEvent = useMemo(() => Animated.event(
[{ nativeEvent: { translationX: dragX } }],
{ useNativeDriver: true },
), [dragX]);
return (
<>
<PanGestureHandler
activeOffsetX={8}
onGestureEvent={onGestureEvent}
onHandlerStateChange={() => {}}
>
<Animated.View />
</PanGestureHandler>
<RNCamera
captureAudio={false}
style={{ flex: 1 }}
/>
</>
);
};