Add prop to show capture count

This commit is contained in:
aarongrider 2021-01-05 16:38:30 -08:00
parent f621232fe6
commit dd597249c2
3 changed files with 8 additions and 3 deletions

View File

@ -68,6 +68,7 @@ import { CameraScreen } from 'react-native-camera-kit';
}}
cameraFlipImage={require('path/to/image')}
captureButtonImage={require('path/to/image')}
showCapturedImageCount={false} // (default false) optional, show count for photos taken during that capture session
/>
```

View File

@ -28,6 +28,7 @@ export default class CameraScreenExample extends Component {
}}
cameraFlipImage={require('../images/cameraFlipIcon.png')}
captureButtonImage={require('../images/cameraButton.png')}
showCapturedImageCount
/>
);
}

View File

@ -37,6 +37,7 @@ export type Props = {
ratioOverlayColor?: string,
allowCaptureRetake: boolean,
cameraRatioOverlay: any,
showCapturedImageCount?: boolean,
scannerOptions: any,
offsetForScannerFrame: any,
heightForScannerFrame: any,
@ -228,9 +229,11 @@ export default class CameraScreenBase extends Component<Props, State> {
<View style={styles.captureButtonContainer}>
<TouchableOpacity onPress={() => this.onCaptureImagePressed()}>
<Image source={this.props.captureButtonImage} resizeMode="contain" />
<View style={styles.textNumberContainer}>
<Text>{this.numberOfImagesTaken()}</Text>
</View>
{this.props.showCapturedImageCount && (
<View style={styles.textNumberContainer}>
<Text>{this.numberOfImagesTaken()}</Text>
</View>
)}
</TouchableOpacity>
</View>
)