ekreutz / react-native-barcode-scanner-google

Barcode scanner for react native, which implements barcode detection from Google's Vision API.
MIT License
113 stars 68 forks source link

Auto focus is not working in samsung tab A #35

Open ananth10 opened 5 years ago

ananth10 commented 5 years ago

Thanks for good scanner . its working faster than react-native-camera scanner. but recently i have test my app in Samsung Tab A. when i opened scan screen its showed blur image. it was not auto focusing at all. every time i need to tap on screen to auto focus. and also camera view was not full screen. please check attached screen shot. First screenshot is without auto focus and Second is with auto focus

React Native Code Part

`

                <BarcodeScanner
                    style={{flex: 1}}
                    onBarcodeRead={({data, type}) => {
                        // handle your scanned barcodes here!
                        // as an example, we show an alert:
                        this.goNextScreen(data)
                        // Alert.alert(
                        //     `Barcode '${data}' of type '${type}' was scanned.`
                        // );
                    }}

                    onException={exceptionKey => {
                        // check instructions on Github for a more detailed overview of these exceptions.
                        switch (exceptionKey) {
                            case Exception.NO_PLAY_SERVICES:
                                // tell the user they need to update Google Play Services
                                console.log('Exception:',Exception.NO_PLAY_SERVICES)
                                Alert.alert(
                                    `Please update latest version of google play store app or do login with play store before use scanner.`
                                );
                                break;
                            case Exception.LOW_STORAGE:
                                // tell the user their device doesn't have enough storage to fit the barcode scanning magic
                                console.log('Exception:',Exception.LOW_STORAGE)
                                Alert.alert(
                                    `Low storage, please check your internal storage.`
                                );
                                break;
                            case Exception.NOT_OPERATIONAL:
                                // Google's barcode magic is being downloaded, but is not yet operational.
                                console.log('Exception:',Exception.NOT_OPERATIONAL)
                                Alert.alert(
                                    `Please wait or check your internet connection then re-open scanner.`
                                );
                                break;
                            default:
                                break;
                        }

                    }}

                    focusMode={FocusMode.AUTO}
                />

                <View style={styles.rectStyle}>
                <ScannerSquareView
                    maskColor={this.props.maskColor}
                    cornerColor={this.props.cornerColor}
                    borderColor={this.props.borderColor}
                    rectHeight={this.props.rectHeight}
                    rectWidth={this.props.rectWidth}
                    borderWidth={this.props.borderWidth}
                    cornerBorderWidth={this.props.cornerBorderWidth}
                    cornerBorderLength={this.props.cornerBorderLength}
                    isLoading={this.props.isLoading}
                    cornerOffsetSize={this.props.cornerOffsetSize}
                    isCornerOffset={this.props.isCornerOffset}
                    bottomMenuHeight={this.props.bottomMenuHeight}
                    scanBarAnimateTime={this.props.scanBarAnimateTime}
                    scanBarColor={this.props.scanBarColor}
                    scanBarHeight={this.props.scanBarHeight}
                    scanBarMargin={this.props.scanBarMargin}
                    hintText={this.props.hintText}
                    hintTextStyle={this.props.hintTextStyle}
                    scanBarImage={this.props.scanBarImage}
                    hintTextPosition={this.props.hintTextPosition}
                    isShowScanBar={this.props.isShowScanBar}
                />
                </View>
            </View>`

Samsung Tab A Info

Resolution : 800x1280

OS : 5.1.1

without auto focus with auto focus