Add prop to show capture count
This commit is contained in:
parent
f621232fe6
commit
dd597249c2
|
@ -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
|
||||
/>
|
||||
```
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ export default class CameraScreenExample extends Component {
|
|||
}}
|
||||
cameraFlipImage={require('../images/cameraFlipIcon.png')}
|
||||
captureButtonImage={require('../images/cameraButton.png')}
|
||||
showCapturedImageCount
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue