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)
- Unresolved reference: expo
- [expo-image][Android] blurRadius not working for AVIFs
- [notifications][android] addPushTokenListener should called after request token
- Back Button not visible when coming from deeplink in the closed app HOT 1
- expo-image-picker returns videos in .MOV format on iOS even when videos are in MP4 format HOT 1
- expo-image-picker returns videos in .MOV format on iOS even when videos are in MP4 format HOT 1
- expo-image-picker returns videos in .MOV format on iOS even when videos are in MP4 format HOT 3
- [expo-sqlite] Expo Sqlite with Typeorm don't trigger constraint errors. HOT 2
- Expo iOS Simulator Crashes in All Instances Referenced in React Native Documentation HOT 1
- Drawer does not support dynamic routes HOT 1
- Expo Stuck in "New update available, downloading" Screen HOT 1
- Environment variables undefined, causing app to crash HOT 1
- Interface freezes when dismissing a screen with gestures after dismissing a modal with gestures HOT 1
- [expo-video] Component crashing on unmount HOT 1
- hash in useLocalSearchParams not working on loading a page
- CLI can't install pods HOT 2
- [expo-av] Fullscreen mode forces to use native controls instead of custom controls HOT 1
- How to detect what types of cameras (front/back) a device supports? HOT 1
- Can't get Read SMS Permission with expo HOT 1
- How can I debug Hot Module Replacement in my project? HOT 1
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.