You're correct, the documentation is quite poor (I suppose because the library has been in alpha up until recently).
To change the flash mode:
Keep a reference to the ImageCapture
object when binding:
imageCapture = ImageCapture.Builder()
.setFlashMode(ImageCapture.FLASH_MODE_AUTO)
.setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
.setTargetAspectRatio(aspectRatio)
.setTargetRotation(rotation)
.build()
When you want to change the flash mode (e.g when the user taps the flash icon):
flashMode = ImageCapture.FLASH_MODE_OFF
Focus and metering are a little bit more involved, you can see the classes you should be using here.
As for noise reduction and white balance, I believe you'll need to still need to use the Camera2 libraries.
implementation "androidx.camera:camera-camera2:${camerax_version}"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…