react-native-camera-kit
react-native-camera-kit copied to clipboard
Add the ability to disable focus frame (ex. for a camera preview)
Is your feature request related to a problem? Please describe. In a camera preview it would be nice to hide the focus frame.
Describe the solution you'd like A prop to disable focus frame
Describe alternatives you've considered Manage the focus frame color with the option to set it to transparent
Hi, if you really need this in android (dont know about ios), go to node_modules>react-native-camera-kit>android>src>main>java>com>rncamerakit>CKCamera.kt and change these lines
- if you want to make the tap to focus from green to transparent
private val paint = Paint().apply {
style = Paint.Style.STROKE
//color = ContextCompat.getColor(context, android.R.color.holo_green_light)
color = ContextCompat.getColor(context, android.R.color.transparent) //change color to transparent
strokeWidth = 5f
}
- If you want to disable the tap to focus, comment out these whole code from the same file
// Tap to focus
viewFinder.setOnTouchListener { _, event ->
if (event.action != MotionEvent.ACTION_UP) {
return@setOnTouchListener scaleDetector.onTouchEvent(event)
}
focusOnPoint(event.x, event.y)
return@setOnTouchListener true
}
Rebuilt your app