Lines Matching refs:state

84   readonly state: State = {
130 this.setState((state) => ({ showGallery: !state.showGallery, newPhotos: false }));
132 toggleMoreOptions = () => this.setState((state) => ({ showMoreOptions: !state.showMoreOptions }));
135 this.setState((state) => ({
136 type: state.type === CameraType.back ? CameraType.front : CameraType.back,
139 toggleFlash = () => this.setState((state) => ({ flash: flashModeOrder[state.flash] }));
143 toggleWB = () => this.setState((state) => ({ whiteBalance: wbOrder[state.whiteBalance] }));
146 this.setState((state) => ({
147 autoFocus: state.autoFocus === AutoFocus.on ? AutoFocus.off : AutoFocus.on,
150 zoomOut = () => this.setState((state) => ({ zoom: state.zoom - 0.1 < 0 ? 0 : state.zoom - 0.1 }));
152 zoomIn = () => this.setState((state) => ({ zoom: state.zoom + 0.1 > 1 ? 1 : state.zoom + 0.1 }));
157 this.setState((state) => ({ barcodeScanning: !state.barcodeScanning }));
159 toggleFaceDetection = () => this.setState((state) => ({ faceDetecting: !state.faceDetecting }));
169 this.setState((state) => ({ recording: !state.recording }));
170 if (this.state.recording) {
190 this.setState((state) => ({ mode: state.mode === 'picture' ? 'video' : 'picture' }));
219 const { ratio } = this.state;
236 this.setState((state) => {
237 let newId = state.pictureSizeId + direction;
238 const length = state.pictureSizes.length;
245 pictureSize: state.pictureSizes[newId],
257 {this.state.faces.map(face)}
263 {this.state.faces.map(landmarks)}
269 {this.state.permission && (
272 Permission {this.state.permission.toLowerCase()}!
288 <Ionicons name={flashIcons[this.state.flash] as any} size={28} color="white" />
292 name={wbIcons[this.state.whiteBalance] as any}
301 { color: this.state.autoFocus === 'on' ? 'white' : '#6b6b6b' },
316 name={this.state.mode === 'picture' ? 'image' : 'video'}
323 onPress={this.state.mode === 'picture' ? this.takePicture : this.takeVideo}
325 {this.state.recording ? (
331 color={this.state.mode === 'picture' ? 'white' : 'red'}
339 {this.state.newPhotos && <View style={styles.newPhotosDot} />}
352 color={this.state.faceDetecting ? 'white' : '#858585'}
359 color={this.state.barcodeScanning ? 'white' : '#858585'}
371 <Text style={{ color: 'white' }}>{this.state.pictureSize}</Text>
382 const origin: BarCodePoint | undefined = this.state.cornerPoints
383 ? this.state.cornerPoints[0]
389 {this.state.barcodeData}
394 points={this.state.cornerPoints?.map((coord) => `${coord.x},${coord.y}`).join(' ')}
408 type={this.state.type}
409 flashMode={FlashMode[this.state.flash]}
410 autoFocus={AutoFocus[this.state.autoFocus]}
411 zoom={this.state.zoom}
412 whiteBalance={WhiteBalance[this.state.whiteBalance]}
413 ratio={this.state.ratio}
414 pictureSize={this.state.pictureSize}
416 onFacesDetected={this.state.faceDetecting ? this.onFacesDetected : undefined}
426 onBarCodeScanned={this.state.barcodeScanning ? this.onBarCodeScanned : undefined}>
431 {this.state.faceDetecting && this.renderFaces()}
432 {this.state.faceDetecting && this.renderLandmarks()}
433 {this.state.barcodeScanning && this.renderBarCode()}
434 {this.state.showMoreOptions && this.renderMoreOptions()}
439 const cameraScreenContent = this.state.permissionsGranted
442 const content = this.state.showGallery ? this.renderGallery() : cameraScreenContent;