Man Camera2 APIs are hard to master…
I’ve scanned SO for a way to get touch-to-focus to work on Android and could not find a solution that works.
These were very partial, or provided only scaffold code which I couldn’t use:
- http://stackoverflow.com/questions/33151244/implement-tap-to-focus-in-camera2-api
- http://stackoverflow.com/questions/41649691/android-camera2-api-touch-to-focus-example
- http://stackoverflow.com/questions/34681903/android-camera2-touch-to-focus-implementation-cancelling-on-new-touch
- http://stackoverflow.com/questions/39850590/android-camera2-tap-to-focus
- https://www.reddit.com/r/androiddev/comments/3mpa90/camera2_touch_focus/
Finally I was able to do it by myself this way:
Enjoy
Roy