Open oliviermartin opened 4 hours ago
Guten Tag, Hans here. Thank you for your detailed report! It looks like you are experiencing a valid issue with the
However, I noticed that you didn’t try to reproduce this issue in the VisionCamera Example app. This is important for us to understand if it is an issue specific to your app or a potential bug in the library itself. Please give it a try and let us know the results.
Also, if you could provide more logs surrounding the initialization process or any errors you might see, it would greatly help mrousavy in diagnosing the issue further. You can gather them by running adb logcat
if you're using Android.
Feel free to follow up after trying the example app. Cheers! 🍻
Note: If you think I made a mistake, please ping
@mrousavy
to take a look.
I have just tried VisionCamera Example app. The application is in full screen.
I did modify the example app to be closer to my case and it seems to work (ie: the
--- a/package/example/src/CameraPage.tsx
+++ b/package/example/src/CameraPage.tsx
@@ -195,11 +195,12 @@ export function CameraPage({ navigation }: Props): React.ReactElement {
return (
<View style={styles.container}>
{device != null ? (
+ <View style={styles.camera_view}>
<PinchGestureHandler onGestureEvent={onPinchGesture} enabled={isActive}>
- <Reanimated.View onTouchEnd={onFocusTap} style={StyleSheet.absoluteFill}>
+ <Reanimated.View onTouchEnd={onFocusTap} style={styles.camera}>
<TapGestureHandler onEnded={onDoubleTap} numberOfTaps={2}>
<ReanimatedCamera
- style={StyleSheet.absoluteFill}
+ style={styles.camera}
device={device}
isActive={isActive}
ref={camera}
@@ -232,6 +233,7 @@ export function CameraPage({ navigation }: Props): React.ReactElement {
</TapGestureHandler>
</Reanimated.View>
</PinchGestureHandler>
+ </View>
) : (
<View style={styles.emptyContainer}>
<Text style={styles.text}>Your phone does not have a Camera.</Text>
@@ -289,9 +291,15 @@ export function CameraPage({ navigation }: Props): React.ReactElement {
const styles = StyleSheet.create({
container: {
- flex: 1,
- backgroundColor: 'black',
+ flex: 1, alignItems: 'center', justifyContent: 'center',
+ backgroundColor: 'red',
+ },
+ camera_view: {
+ paddingBottom: 20,
+ alignItems: 'center',
+ justifyContent: 'center',
},
+ camera: {width: 150, height: 300, zIndex: 0},
captureButton: {
position: 'absolute',
alignSelf: 'center',
But the VisionCamera Example app is much more complex than my test app. I do not know whether I missed something.
cc: @mrousavy
What's happening?
In my simple app, the first time I start it, the is located at the top left corner of the screen while I expect it to be in the middle of the screen.
But when coming back on the screen, the is now located in the middle of the screen.
What I see:
On the screen reload:
Reproduceable Code
Relevant log output
Camera Device
Device
Samsung Galaxy A20e (Android 11)
VisionCamera Version
4.5.3
Can you reproduce this issue in the VisionCamera Example app?
I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Additional information