diff --git a/README.md b/README.md index 3094753..ead431e 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ fun buildCameraEventListener(): CameraEventListener = object : CameraEventListen | startPreview | - | - | void | Start camera preview if has permission. | startCaptureType | `captureType: String` | | void | Set capture type none, face, QR Code or frame. | stopCapture | - | - | void | Stop any type of capture. -| destroy | - | - | void | Remove camera preview and listeners. +| destroy | - | - | void | Remove camera preview. | toggleCameraLens | - | - | void | Set camera lens facing front or back. | setCameraLens | `cameraLens: String` | | void | Set camera to use "front" or "back" lens. Default value is "front". | getCameraLens | - | - | Int | Return `Int` that represents lens face state: 0 for front 1 for back camera. diff --git a/app/src/main/java/ai/cyberlabs/yoonit/camerademo/MainActivity.kt b/app/src/main/java/ai/cyberlabs/yoonit/camerademo/MainActivity.kt index 41371fa..41c121e 100644 --- a/app/src/main/java/ai/cyberlabs/yoonit/camerademo/MainActivity.kt +++ b/app/src/main/java/ai/cyberlabs/yoonit/camerademo/MainActivity.kt @@ -165,7 +165,6 @@ class MainActivity : AppCompatActivity() { fun cameraStateSwitchClick(view: View) { if (view is SwitchCompat) { if (view.isChecked) { - this.cameraView.setCameraEventListener(this.buildCameraEventListener()) this.cameraView.startPreview() return } diff --git a/yoonit-camera/src/main/java/ai/cyberlabs/yoonit/camera/CameraView.kt b/yoonit-camera/src/main/java/ai/cyberlabs/yoonit/camera/CameraView.kt index 58e1ce0..affe1ce 100644 --- a/yoonit-camera/src/main/java/ai/cyberlabs/yoonit/camera/CameraView.kt +++ b/yoonit-camera/src/main/java/ai/cyberlabs/yoonit/camera/CameraView.kt @@ -110,7 +110,6 @@ open class CameraView @JvmOverloads constructor( * Destroy camera. */ fun destroy() { - this.setCameraEventListener(null) this.cameraController.destroy() }