Comments (4)
@yohavrotsztein see referenced PR
from expo.
facing the same issue
import React, { useState, useEffect } from "react";
import { Text, View, StyleSheet, Button, Dimensions } from "react-native";
import { CameraView, Camera } from "expo-camera";
import { BlurView } from "expo-blur";
export default function App() {
const [hasPermission, setHasPermission] = useState(null);
const [scanned, setScanned] = useState(false);
const { width, height } = Dimensions.get('window');
const squareSize = Math.min(width, height) * 0.6; // Set the square size to 60% of the smaller dimension
const topHeight = (height - squareSize) / 2;
const sideWidth = (width - squareSize) / 2;
useEffect(() => {
const getCameraPermissions = async () => {
const { status } = await Camera.requestCameraPermissionsAsync();
setHasPermission(status === "granted");
};
getCameraPermissions();
}, []);
const handleBarCodeScanned = ({ type, data }) => {
setScanned(true);
alert(`Bar code with type ${type} and data ${data} has been scanned!`);
};
if (hasPermission === null) {
return <Text>Requesting for camera permission</Text>;
}
if (hasPermission === false) {
return <Text>No access to camera</Text>;
}
return (
<View style={styles.container}>
<CameraView
enableTorch= {true}
onBarcodeScanned={scanned ? undefined : handleBarCodeScanned}
barcodeScannerSettings={{
barcodeTypes: ["qr", "pdf417"],
}}
style={StyleSheet.absoluteFillObject}
/>
<View style={styles.overlay}>
{/* Top Blur */}
<BlurView intensity={50} style={[styles.blur, { top: 0, height: 250, width }]} />
{/* Bottom Blur */}
<BlurView intensity={50} style={[styles.blur, { bottom: 0, height: 250, width }]} />
{/* Left Blur */}
<BlurView intensity={50} style={[styles.blur, { top: 250, height: 235, width: 100, right:320 }]} />
{/* Right Blur */}
<BlurView intensity={50} style={[styles.blur, { top: 250, height: 235, left: 320, width: sideWidth }]} />
</View>
{scanned && (
<Button title={"Tap to Scan Again"} onPress={() => setScanned(false)} />
)}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
overlay: {
...StyleSheet.absoluteFillObject,
justifyContent: 'center',
alignItems: 'center',
},
blur: {
position: 'absolute',
backgroundColor: 'rgba(0, 0, 0, 0.7 )',
},
});
from expo.
Thank you for filing this issue!
This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.
from expo.
Same here. And the torch is really the center of my app. Any news about this?
from expo.
Related Issues (20)
- [expo-av audio] Unable to make an audio recording with a sampling frequency lower than the microphone's default frequency on iOS
- Dev launcher tries connecting to dev server while running an expo update
- websocket connection fail between appwrite realtime service and expo web HOT 4
- headerLeft option not working for Stack when presentation is 'modal'
- printToFileAsync not resolving when triggered multiple time in android HOT 1
- Accept generic type parameters for Expo API Routes HOT 1
- Tabs broken in latest expo router with array syntax screens HOT 4
- Update your target API level 34 HOT 1
- SplashScreen is automatically dismissed in development client HOT 6
- Android/IOS Store build fail when using alias path HOT 4
- [expo-notifications] FCMv1 payload structure should be simplified HOT 2
- Expo CMAKE LONG PATH ERROR HOT 1
- [iOS] sqlite3 build errors with expo-updates HOT 3
- expo-camera not working HOT 1
- [expo-local-authentication] Android: crash when setting disableDeviceFallback to true (unless cancelLabel is set) HOT 1
- expo-image-picker crashing, no errors thrown In IOS 17.5 HOT 2
- expo-image-picker crashing, no errors thrown In IOS 17.5 HOT 1
- expo-image-picker crashing, no errors thrown In IOS 17.5 HOT 2
- The --no-bundler flag throws errors HOT 3
- Motion permission on IOS has status granted but is not granted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expo.