Skip to content

Commit

Permalink
Fix: Correct onScale method signature in CKCamera.kt (again)
Browse files Browse the repository at this point in the history
#559 broke a change in #551 regarding override types. This restores the fix
  • Loading branch information
elliottkember authored Oct 3, 2023
1 parent 91915bf commit 54a35f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions android/src/main/java/com/rncamerakit/CKCamera.kt
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ class CKCamera(context: ThemedReactContext) : FrameLayout(context), LifecycleObs
orientationListener!!.enable()

val scaleDetector = ScaleGestureDetector(context, object: ScaleGestureDetector.SimpleOnScaleGestureListener() {
override fun onScaleBegin(detector: ScaleGestureDetector?): Boolean {
override fun onScaleBegin(detector: ScaleGestureDetector): Boolean {
val cameraZoom = camera?.cameraInfo?.zoomState?.value?.zoomRatio ?: return false
detector ?: return false
zoomStartedAt = cameraZoom
pinchGestureStartedAt = detector.currentSpan
return true
}
override fun onScale(detector: ScaleGestureDetector?): Boolean {
override fun onScale(detector: ScaleGestureDetector): Boolean {
if (zoomMode == "off") return true
if (detector == null) return true
val videoDevice = camera ?: return true
Expand Down

0 comments on commit 54a35f6

Please sign in to comment.