I have watched
this video from Android Developers on youtube, and Smooth Zoom was mentioned.
It said that CameraX automatically uses all the cameras for more zoom range - like the default device camera, but for some reason it does not seem to work with my
implementation - min zoom level is 1x unlike the default device camera and in video example which both have zoom level under 1x.
My implementation:
override fun onScale(detector: ScaleGestureDetector?): Boolean {
val zoomRatio = camera.cameraInfo.zoomState.value?.zoomRatio?.times(detector!!.scaleFactor)
zoomRatio?.let {
// Setting new zoom ratio for CameraX
camera.cameraControl.setZoomRatio(it)
}
return true
}
Thanks,
Raz