code-scanner icon indicating copy to clipboard operation
code-scanner copied to clipboard

Camera switching

Open dietmarschuettler opened this issue 3 years ago • 1 comments

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.

dietmarschuettler avatar Dec 16 '21 15:12 dietmarschuettler

do this:

switchCameraButton.setOnClickListener {
            codeScanner.apply {
                camera = if (camera == 1) {
                    CodeScanner.CAMERA_BACK
                } else {
                    CodeScanner.CAMERA_FRONT
                }
            }
        }

asephermann avatar Sep 19 '23 02:09 asephermann