code-scanner
code-scanner copied to clipboard
Camera switching
Again I hate to complain. And this is only a suggestion. The scanner supports already front and rear cameras. And one can select the camera to be used. It would be much nice if the camera could be changed with an icon like the flash icon in the scanner view. Maybe also with attributes to make the button visible and select the camera from XML.
do this:
switchCameraButton.setOnClickListener {
codeScanner.apply {
camera = if (camera == 1) {
CodeScanner.CAMERA_BACK
} else {
CodeScanner.CAMERA_FRONT
}
}
}