Skip to content

Conversation

@temcguir
Copy link
Collaborator

Switching to/from tabletop mode causes the underlying SurfaceView to
destroy and recreate its Surface, but the Camera doesn't know its
been destroyed. This is a known issue with SurfaceView in Compose.
See: https://issuetracker.google.com/275157240

To workaround this issue, detect when the folding state enters or
leaves tabletop mode and manually invalidate the CameraX
SurfaceRequest so it will generate a new one.

 Switching to/from tabletop mode causes the underlying SurfaceView to
 destroy and recreate its Surface, but the Camera doesn't know its
 been destroyed. This is a known issue with SurfaceView in Compose.
 See: https://issuetracker.google.com/275157240

 To workaround this issue, detect when the folding state enters or
 leaves tabletop mode and manually invalidate the CameraX
 SurfaceRequest so it will generate a new one.
@temcguir temcguir requested a review from riggaroo May 14, 2025 23:33
@temcguir temcguir merged commit f01bade into main May 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants