Skip to content

Instantly share code, notes, and snippets.

@Kashif-E
Created March 6, 2021 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kashif-E/1d15b673f33c8a2da4566a601815031c to your computer and use it in GitHub Desktop.
Save Kashif-E/1d15b673f33c8a2da4566a601815031c to your computer and use it in GitHub Desktop.
val cameraProviderFuture = ProcessCameraProvider.getInstance(requireContext())
cameraProviderFuture.addListener(Runnable {
val cameraProvider = cameraProviderFuture.get()
preview = Preview.Builder().build().apply {
setSurfaceProvider(binding.viewFinderPkgDetails.createSurfaceProvider())
}
}, ContextCompat.getMainExecutor(requireContext()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment