I'm building simple barcode reader with Android Vision API using googlesamples as guide. The problem is that I want to add toggle button for turning flash on/off, but method public Builder setFlashMode(@FlashMode String mode)
used in the googlesamples code is missing in the latest version of Vision API implementation 'com.google.android.gms:play-services-vision:17.0.2'
I've tried to find out if this method has been replaced with something else by digging through Vision Java Doc but had no luck.
I'm using basically the same code as in BarcodeCaptureActivity
in the googlesamples for barcode detection and that part works perfectly , I just need to add option to turn on flash light.
Is there any way to do this using code from googlesamples, or I need to downgrade to some old version of Vision or change my approach altogether.