I was upgrading cameraX alpha to 1.0.0-beta03 in my project. I am following this. Everything is working and I am able to take an image as expected.
But I have a bottom sheet in the camera fragment. After I have implemented the beta03, while scrolling the bottom sheet, it seems to be overlapped by some invisible view, like this:
After debugging for some time found out this is only happening when I pass camera?.cameraInfo to viewFinder.createSurfaceProvider. If I pass null, this issue is not happening. But I don't know the implications of this.
preview?.setSurfaceProvider(
viewFinder.createSurfaceProvider(camera?.cameraInfo))
When I pass null here, The bottom sheet completely comes up.
This is what the documentation says:
/**
* Gets the {@link Preview.SurfaceProvider} to be used with
* {@link Preview#setSurfaceProvider(Executor, Preview.SurfaceProvider)}.
* <p>
* The returned {@link Preview.SurfaceProvider} will provide a preview
* {@link android.view.Surface} to the camera that's either managed by a
* {@link android.view.TextureView} or {@link android.view.SurfaceView}. This option is
* determined by the {@linkplain #setPreferredImplementationMode(ImplementationMode)
* preferred implementation mode} and the device's capabilities.
*
* @param cameraInfo The {@link CameraInfo} of the camera that will use the
* {@link android.view.Surface} provided by the returned
* {@link Preview.SurfaceProvider}.
* @return A {@link Preview.SurfaceProvider} used to start the camera preview.
*/
I have added a random bottom sheet to google's sample app and pushed it here(Github link) with the bug reproduced. (Please build Cameraxbasic module. My branch is Bug_repro_bottomsheet)
Can someone please explain whats going on and how to fix this?
Note: I tried updating the z-index and elevation of the bottom sheet. and it didn't work
