Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val scaleDetector = ScaleGestureDetector(context, listener)
override fun onTouchEvent(event: MotionEvent) : Boolean {
// Let the ScaleGestureDetector inspect all events
scaleDetector.onTouchEvent(event)
return true
}
val listener = object : ScaleGestureDetector.SimpleOnScaleGestureListener() {
override fun onScale(detector: ScaleGestureDetector): Boolean {
val scale = cameraControl.getZoomRatio.getValue() * detector.getScaleFactor()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.