Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Hi Doudera,
Thank you for reporting this issue. It is working as intended. This is because the state of CameraControl follows Camera. Once the Camera is closed, all settings will be restored, just like the settings of the focus area and zoom level. The app can restore the torch state by resetting torch at the time of activity onResume.
jb...@google.com <jb...@google.com> #3
Hello,
thank you for the fast reply. The behaviour is unexpected to me because if you have the same code as before and just add logging like this:
camera = cameraProvider.bindToLifecycle(
this, cameraSelector, preview, imageCapture, imageAnalyzer)
.apply {
Log.d(TAG, "Enabling torch after binding") // <-- called everytime it returns to Activity so next statement should be applied
cameraControl.enableTorch(true)
}
The log is always called even when returning to Activity so I suppose it should be applied. Why it is not applied when it is called?
Unfortunately, I cannot make it work even with your hint. I tried to add camera?.cameraControl?.enableTorch(true) to onResume() but without any effect. Can you please describe more how to reset torch state onResume().
As you said the same happens with setZoomRatio() etc.
Thank you, Martin
thank you for the fast reply. The behaviour is unexpected to me because if you have the same code as before and just add logging like this:
camera = cameraProvider.bindToLifecycle(
this, cameraSelector, preview, imageCapture, imageAnalyzer)
.apply {
Log.d(TAG, "Enabling torch after binding") // <-- called everytime it returns to Activity so next statement should be applied
cameraControl.enableTorch(true)
}
The log is always called even when returning to Activity so I suppose it should be applied. Why it is not applied when it is called?
Unfortunately, I cannot make it work even with your hint. I tried to add camera?.cameraControl?.enableTorch(true) to onResume() but without any effect. Can you please describe more how to reset torch state onResume().
As you said the same happens with setZoomRatio() etc.
Thank you, Martin
jp...@gmail.com <jp...@gmail.com> #4
Hi Doudera, Thank you for the detail description. It sounds like some problem in the code. I will investigate it more.
Description
Components used: Fragment, AppCompat
Fragment version used: 1.3.0-beta02
AppCompat version used: 1.3.0-alpha02
Devices/Android versions reproduced on: API 28 (device), API 30 (emulator)
The following code is resulting in animation flickering:
This seems like a regression, as using
Fragment 1.2.5
andAppCompat 1.2.0
works as expected.This bug can be reproduced in the following test project and is only noticeable when fading from
fragment2
tofragment1
:A screen record of the issue is also attached.
Thank you for taking a look into this issue.