fix inconsistencies when user switches camera mode fast

- debounce switching by 500ms when toggling between video/photo capture
- ensure there is only one source of truth for the current camera mode - this is the CameraXPreview
- refactor the MainActivity to depend on the CameraXPreview for the camera mode
- remove unused code in CameraXPreviewListener, MyPreview and in MainActivity
This commit is contained in:
darthpaul
2022-11-23 14:32:16 +00:00
parent c858e5b908
commit fc2296e2ae
6 changed files with 148 additions and 223 deletions

View File

@ -23,7 +23,8 @@ class CameraXInitializer(private val activity: BaseSimpleActivity) {
mediaOutputHelper,
cameraErrorHandler,
listener,
initInPhotoMode,
isThirdPartyIntent = isThirdPartyIntent,
initInPhotoMode = initInPhotoMode,
)
}