Skip to content

Commit

Permalink
Merge pull request #41 from Yoonit-Labs/development
Browse files Browse the repository at this point in the history
Remove listener removal from destroy method
  • Loading branch information
Goulartvic authored Jan 25, 2021
2 parents f5ce87f + eec22c7 commit 594f8ef
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fun buildCameraEventListener(): CameraEventListener = object : CameraEventListen
| startPreview | - | - | void | Start camera preview if has permission.
| startCaptureType | `captureType: String` | <ul><li>`"none"`</li><li>`"face"`</li><li>`"qcode"`</li><li>`"frame"`</li></ul> | 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` | <ul><li>`"front"`</li><li>`"back"`</li></ul> | 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ open class CameraView @JvmOverloads constructor(
* Destroy camera.
*/
fun destroy() {
this.setCameraEventListener(null)
this.cameraController.destroy()
}

Expand Down

0 comments on commit 594f8ef

Please sign in to comment.